win32com.client.constants - AttributeError

kbperry keith.b.perry at gmail.com
Thu Apr 20 16:43:49 EDT 2006


On my machine, this runs fine, but when I try to run it on someone
elses machine it blows up with an attribute error:

<code>
import win32com.client, pythoncom

pythoncom.CoInitializeEx(pythoncom.COINIT_APARTMENTTHREADED)
myWord = win32com.client.dynamic.Dispatch ("Word.Application")
myWord.Visible = True
myDoc = myWord.Documents.Open(FileName= "C:\Test.doc")
myDoc .SaveAs(FileName = "c:\Test.htm", FileFormat =
win32com.client.constants.wdFormatHTML)

myDoc.Saved=1
myWord.Quit ()

del myWord
pythoncom.CoUninitialize()
</code>

It's pretty simple code so I don't understand why it doesn't work.  I
verified that he has the same pywin32 module as me (build 207) and the
same python version (2.4.2).

Any ideas?




More information about the Python-list mailing list