将 VSDX 文件批量转换为 VSD
Bulk conversion VSDX files to VSD
有没有什么优雅的方法可以将 VSDX 文件批量转换为 VSD?
请注意 - 这是实际降级,而不是相反。
是否可以通过脚本实现?
还是我留给第 3 方工具..?
非常感谢
亲切的问候
VBA Visio 文件中的宏可以做到...
Sub Converter()
Dim StrFile As String
Dim objFSO, destRow As Long
Dim mainFolder, mySubFolder
Dim fullPathFileName
Set objFSO = CreateObject("Scripting.FileSystemObject")
mFolder = "C:\Users\sivancik001\Desktop\vsdx\" ' <<<< PATH TO BE CHANGED !!!!
Set mainFolder = objFSO.GetFolder(mFolder)
StrFile = Dir(mFolder & "*.vsdx*")
'Do While Len(StrFile) > 0
'... actions here ... but not needed as nothing should be in the root folder. files are in subfolders
'StrFile = Dir
'Loop
For Each mySubFolder In mainFolder.SubFolders
StrFile = Dir(mySubFolder & "\*.vsdx*")
Do While Len(StrFile) > 0
fullPathFileName = mySubFolder & "\" & StrFile
'MsgBox fullPathFileName
Application.Documents.Open fullPathFileName
Application.ActiveDocument.SaveAs Left(fullPathFileName, Len(fullPathFileName) - 1)
Application.ActiveDocument.Close
Kill fullPathFileName
StrFile = Dir
Loop
Next
End Sub
有没有什么优雅的方法可以将 VSDX 文件批量转换为 VSD? 请注意 - 这是实际降级,而不是相反。 是否可以通过脚本实现? 还是我留给第 3 方工具..? 非常感谢 亲切的问候
VBA Visio 文件中的宏可以做到...
Sub Converter()
Dim StrFile As String
Dim objFSO, destRow As Long
Dim mainFolder, mySubFolder
Dim fullPathFileName
Set objFSO = CreateObject("Scripting.FileSystemObject")
mFolder = "C:\Users\sivancik001\Desktop\vsdx\" ' <<<< PATH TO BE CHANGED !!!!
Set mainFolder = objFSO.GetFolder(mFolder)
StrFile = Dir(mFolder & "*.vsdx*")
'Do While Len(StrFile) > 0
'... actions here ... but not needed as nothing should be in the root folder. files are in subfolders
'StrFile = Dir
'Loop
For Each mySubFolder In mainFolder.SubFolders
StrFile = Dir(mySubFolder & "\*.vsdx*")
Do While Len(StrFile) > 0
fullPathFileName = mySubFolder & "\" & StrFile
'MsgBox fullPathFileName
Application.Documents.Open fullPathFileName
Application.ActiveDocument.SaveAs Left(fullPathFileName, Len(fullPathFileName) - 1)
Application.ActiveDocument.Close
Kill fullPathFileName
StrFile = Dir
Loop
Next
End Sub