I would like to create a script that opens Visio files (.vsd), save it to vsdx, pdf and svg (with every page of vsd being seperate file), close the file, opens the next until end of files.
So far i was successful with saving it to .pdf using: Python Visio to pdf
import win32com.client
#change later to dynamic current path
path= r"C:/automation_visio/"
visio = win32com.client.Dispatch("Visio.Application")
doc = visio.Documents.Open(path+'test.vsd')
doc.ExportAsFixedFormat( 1, path+'test.pdf', 1, 0 ) #exports as pdf only XD
I looked in lots of places (most relevant: https://learn.microsoft.com/en-us/office/vba/api/visio.document.saveas) but to no avail - I don't know how to save to other filetypes which are available with manual "SaveAs".
EDIT: I need to know also how to navigate trough the pages (to get list of pages and iterate trough them and save to svg files) and (shamefully) how to correctly close the file after files are exported.