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' )

-- 
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to