[python-win32] Using win32com Constants
David Carter
dactex at swbell.net
Fri Feb 17 23:29:06 CET 2006
Yes, -those- constants work fine. They're the application specific constants
that require the convolution.
David Carter
> -----Original Message-----
> From: Robert Brewer [mailto:fumanchu at amor.org]
> Sent: Friday, February 17, 2006 4:11 PM
> To: David Carter; python-win32 at python.org
> Subject: RE: [python-win32] Using win32com Constants
>
>
> David Carter wrote:
> > Why is it that when I want to use a win32COM constant such as
> > acViewNormal in an MS Access COM automation session I find I
> > have to use some convoluted thing like:
> >
> > ComConstants =
> > win32com.client.constants.__dict__["__dicts__"][0]
> > viewtype = ComConstants['acViewNormal']
> >
> > Am I missing something obvious?
>
> Are you calling Dispatch before referencing the constants?
>
> http://aspn.activestate.com/ASPN/docs/ActivePython/2.3/pywin32
/html/com/
win32com/HTML/QuickStartClientCom.html
"Makepy automatically installs all generated constants from a type
library in an object called win32com.clients.constants. You do not need
to do anything special to make these constants work, other than create
the object itself (ie, in the example above, the constants relating to
Word would automatically be available after the
w=win32com.client.Dispatch("Word.Application") statement."
Robert Brewer
System Architect
Amor Ministries
fumanchu at amor.org
More information about the Python-win32
mailing list