Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jahentao/6b8dc6dc342c7859f4ea64bb46f167e6 to your computer and use it in GitHub Desktop.
Save jahentao/6b8dc6dc342c7859f4ea64bb46f167e6 to your computer and use it in GitHub Desktop.
导出visio中图片为svg格式(VB脚本)
Public Sub ExportPages()
'Declare object variables as Visio object types.
Dim vsoPage As Visio.Page
Dim vsoDocument As Visio.Document
Dim vsoDocuments As Visio.Documents
Dim vsoPages As Visio.Pages
'Iterate through all open documents.
Set vsoDocuments = Application.Documents
For Each vsoDocument In vsoDocuments
'Print the drawing name in the Visual Basic Editor
'Immediate window.
Debug.Print vsoDocument.FullName
'Iterate through all pages in a drawing.
Set vsoPages = vsoDocument.Pages
For Each vsoPage In vsoPages
'Print the page name in the Visual Basic Editor
'Immediate window.
Debug.Print Tab(5); vsoPage.Name
vsoPage.Export ("D:\jahentao\Documents\ApplicationDevelopment\converted\" + vsoPage.Name + ".svg")
Next
Next
End Sub
@jahentao
Copy link
Author

jahentao commented May 2, 2020

在visio文档中打开宏,运行效果

clipboard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment