McMillian installer + win32com.client.constants - how to use them together?

vtail vtail at yandex.ru
Tue Oct 1 04:50:14 EDT 2002


vtail at yandex.ru (vtail) wrote in message news:<9ff6b66.0209300856.5fcdf961 at posting.google.com>...
> Greetings,
> 
> can anybody please explain me the Right Way to use McMillian installer
> with application that uses constants from MSWord library?
> 
> I've generate them with win32com/client/makepy.py and use them in my
> code via
> ====>
> import win32com.client
> ...
> a = win32com.client.constants.wdBlack  #  application crashed here
> ...
> <===
> 
> When I build .exe from my applications it is crashed on marked line
> with AttributeError exception.
> 
> I've tried to study this subject myself, but now I'm totally confused
> with all this gencache.EnsureModule(), prog_id, CLSID etc. I can't
> find any clear documentation on the subject.
> 
> I'll greatly appreciated any help on this, even RTFM links ;).
> 
> Victor.


I've solved this problem myself.

In this case, using MSWord 2002, I should include two following lines
in my file:

from win32com.client import gencache
gencache.EnsureModule('{00020905-0000-0000-C000-000000000046}',0, 8,
2)

They was received by running
makepy.py -i "Microsoft Word 10.0 Object Model"
as suggested in win32all documentation. This will install constants
support during runtime as far as I can understand.

Victor.



More information about the Python-list mailing list