[python-win32] OpenOffice automation
Raymond Yee
yee@uclink.berkeley.edu
Thu, 09 May 2002 22:36:35 -0700
Please clarify. We typed
objDesktop = objServiceManager.createInstance("com.sun.star.frame.Desktop")
Isn't the syntax we used calling the *method* creatInstance with the parameter
"com.sun.star.frame.Desktop" of objServiceManager -- not the property?
(I consulted
http://aspn.activestate.com//ASPN/Python/Reference/Products/ActivePython/win32com/win32com/win32com/HTML/QuickStartClientCom.html
which
gives the example:
import win32com.client
o = win32com.client.Dispatch("Object.Name")
o.Method()
o.property = "New Value"
print o.property
to distinguish between calling a method and a property
What am I missing here?
-Raymond
Mark Hammond wrote:
> > > >>> objDesktop =
> > > objServiceManager.createInstance("com.sun.star.frame.Desktop")
> > > Traceback (most recent call last):
> > > File "<stdin>", line 1, in ?
> > > TypeError: 'NoneType' object is not callable
>
> It appears that the COM object is returning "None" when a *property* called
> "createInstance" is requested. However, "createInstance" is a method, so an
> attempt to reference it as a property should fail.
>
> You could confirm this by printing "objServiceManager.createInstance" - try
> that in any language - you should find None/Nothing/NULL is returned instead
> of an error.
>
> Mark.
>
> _______________________________________________
> Python-win32 mailing list
> Python-win32@python.org
> http://mail.python.org/mailman/listinfo/python-win32