[python-win32] MSProject and export maps

Ron Henderson Ron.Henderson at dreamworks.com
Thu May 22 05:03:19 CEST 2008


Does anybody know how to avoid the "Export Wizard" when saving a file 
with MSProject?  The FileSaveAs method seems to ignore the Map keyword.  
My code looks essentially like this:

mp = Dispatch("MSProject.Application")
mp.FileOpen(mppFile)
mp.FileSaveAs(csvFile, Format=3, Map="My Export Map")
mp.FileClose(Save=0)
mp.FileQuit()

This gets the correct data into the file, but MSProject pops up the 
"Export Wizard" and forces me to select the map manually in order to 
complete the FileSaveAs() operation.

Other people seem have encountered the same problem, but I haven't seen 
a solution anywhere.

The only workaround I've found is to record this action as a macro and 
execute the macro:

mp = Dispatch("MSProject.Application")
mp.FileOpen(mppFile)
mp.Run("My Export Macro")
mp.FileClose(Save=0)
mp.FileQuit()




More information about the python-win32 mailing list