By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,941 Members | 1,766 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,941 IT Pros & Developers. It's quick & easy.

ValueError: argument is not a COM object

P: n/a
Hi,

I'm scripting Adobe InDesign CS with python, through COM interface.

This is how I get the application object:

win32com.client.Dispatch('InDesign.Application')

I'm not a guru of com programming, but I've gone quite far in my
purpose so far.
Now I'm stuck.

There's a method Add in object Groups (which is in object Page, etc.)
that's supposed to take a parameter called GroupItems of type "Array
of Objects", according to the Visual Basic programming reference.

I have the following piece of code:

print 'obj1: %r, obj2: %r' % (comObjs[0], comObjs[1])
grps = self.page.comPage.Groups
grps.Add( GroupItems=(comObjs[0], comObjs[1]) )

Which gives me:

obj1: <COMObject <unknown>>, obj2: <COMObject <unknown>>

[...]
File "modPrint.py", line 204, in creaFrameLoghi
grps.Add( GroupItems=(comObjs[0], comObjs[1]) )
File "<COMObject <unknown>>", line 2, in Add
ValueError: argument is not a COM object
Why is it so?
I suppose the type system is having troubles figuring out the type of
the list elements.
So, what do I do?

I hope somebody can help,
thank you!
stefano
Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.