467,129 Members | 1,361 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,129 developers. It's quick & easy.

ValueError: argument is not a COM object

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
  • viewed: 1321
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Aki Niimura | last post: by
2 posts views Thread by Mike Hoy | last post: by
3 posts views Thread by Elezar Simeon Papo | last post: by
reply views Thread by Chris Fonnesbeck | last post: by
1 post views Thread by alain MONTMORY | last post: by
3 posts views Thread by winkatl1213@yahoo.com | last post: by
2 posts views Thread by robert | last post: by
8 posts views Thread by Shawn Minisall | last post: by
2 posts views Thread by scriptlearner@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.