On Wednesday 09 December 2009 11:21:40 am Tim Roberts wrote:
> John wrote:
> > ...
> > I'm attempting to use a OCX designed to talk with QuickBooks. I'm using
> > win32com for the first time and have discovered an issue that I'm sure
> > others have run into. But researching google etc. has not helped.
> >
> > obj = win32com.client.Dispatch("InQB.Invoice.1")
> > #In the VB code
> > #obj.ItemName(0) = 'string'
> >
> > #in python I'm trying
> > obj.ItemName[0] = 'string'
> > #error is "Instancemethod object does not support item assignment"
> > ...
> > Just for information the ItemName[0] is an array (I think not a Vb guy)
> > of items on a invoice. ItemName[0] would refer to the first line item on
> > the invoice and ItemName[1] the second and ...
>
> Well, remember that ItemName is not really an array. It's a function
> that happens to look like an array to VB.
>
> The Python COM support will usually provide Set and Get versions for
> indexed properties. Try this:
> obj.SetItemName( 0, 'String' )
Wow Tim thanks that appears to work. But to be honest I don't see where this
code is located.
Johnf
_______________________________________________
python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32