Skip to content

Instantly share code, notes, and snippets.

@Surrogate-TM
Created November 15, 2022 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Surrogate-TM/a951d82662e9fae6079f371e37799076 to your computer and use it in GitHub Desktop.
Save Surrogate-TM/a951d82662e9fae6079f371e37799076 to your computer and use it in GitHub Desktop.

Please save this code with .vbs extension and double click at this file icon at your Windows Explorer

Set va = CreateObject("visio.application")
Set FSO = CreateObject("Scripting.FileSystemObject")
va.Visible = True
va.AlertResponse = 7
path = "C:\test\last" ' change this line for your folder
If Right(path, 1) <> "\" Then path = path + "\"
Set fld = FSO.GETFOLDER(path)
For Each fil In fld.Files
If Right(fil.Name, 3) = "vsd" Or Right(fil.Name, 4) = "vsdx" Then ' iterate only for VSD and VSDX docs
Set vd = va.Documents.OpenEx(path & fil.Name, 256)
vd.Save
vd.Close
Set vd = Nothing
End If
Next
va.AlertResponse = 0
va.Quit
Set va = Nothing
MsgBox "TheEnd!!!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment