Script Collection
Microsoft Visio
Automating Microsoft Visio | Automating Microsoft Visio |
|
|
|
|
This example opens a Microsoft Visio document and prints the save-time and creation-time of the Visio document: import sys, win32com.client doc = sys.argv[1] try: visio = win32com.client.Dispatch("Visio.Application") visio.Visible = 0 try: dwg = visio.Documents.Open(doc) print dwg.TimeCreated, ",", dwg.TimeSaved except Exception, e: print "Error", e dwg.Close() visio.Quit() except Exception, e: print "Error opening file",e |
|
| Last Updated ( Thursday, 02 February 2006 ) |
Hint: For syntax highlighting and correct Python intendation place your code between html tags <pre> and </pre>.