Visio (COM)automation with Python; Problem

Gerrit Muller gerrit.muller at philips.com
Fri Sep 14 12:00:22 CEST 2001


I try to automate the generation of .eps files from visio vsd files. The
small script below isolates a problem, that some files generate eps
files flawless, while for other files Visio simply stops responding.
After killing Visio via the task manager I get the following error
message:

Traceback (most recent call last):
  File "H:\gaudi\PythonTools\epsgenDemo.py", line 7, in ?
    page.Export("h:/gaudi/epsFigures/"+file+".eps")
  File
"C:\Python21\win32com\gen_py\00021A98-0000-0000-C000-000000000046x0x4x6.py",
line 4875, in Export
    return self._oleobj_.InvokeTypes(0x12, LCID, 1, (24, 0), ((8,
1),),FileName)
com_error: (-2147024882, 'Not enough storage is available to complete
this operation.', None, None)

---begin script---
from win32com.client.dynamic import Dispatch

file="test"
##file="AggregationLevelsViews"
v = Dispatch("Visio.Application")
doc = v.Documents.OpenEx("h:/gaudi/figures/"+file+".vsd",2)
page = doc.Pages(1)
page.Export("h:/gaudi/epsFigures/"+file+".eps")
doc.Close()
v.Quit()

---end script---

configuration data:
Visio 5, standard
Activestate Python 2.1.1 build 112

Any suggestion is welcome...

Gerrit
--------------------------------------------------------------------
Gerrit Muller                Philips Research Laboratories Eindhoven
Building:   WDC 2 - 007              Prof. Holstlaan 4
Phone: +31 40 27 45242               5656 AA  Eindhoven
Fax:   +31 40 27 45033               The Netherlands
mailto:gerrit.muller at philips.com
http://www.extra.research.philips.com/natlab/sysarch/index.html



More information about the Python-list mailing list