我有很多Visio文件,并想通过编程将它们全部转换为png格式。
我已经找到了几个解决方案,但都不能让它们工作。
如何通过命令行或类似方法轻松地将.vsd文件批量转换为.png?
发布于 2012-11-16 17:38:13
使用Visual Basic中内置的
如下所示:自己修复路径的各个部分。
Sub a()
Dim docs As New Collection
' add the paths of your documents here, use more script if you want wildcard etc
docs.Add ("C:\Users\[username]\Desktop\New folder (4)\drawing2.vsd")
docs.Add ("C:\Users\[username]\Desktop\New folder (4)\drawing3.vsd")
For Each d In docs
Dim doc As Document
Set doc = Documents.Add(d)
Dim p As Page
For Each p In doc.Pages
Dim n As String
' change this for the output path and format of your choice
n = "C:\Users\[username]\Desktop\New folder (4)\" & doc.Name & " " & p.Index & ".png"
p.Export (n)
Next
Next
End subhttps://stackoverflow.com/questions/13413348
复制相似问题