[python-win32] can't set a property
Tim Roberts
timr at probo.com
Thu Dec 10 01:56:41 CET 2009
John wrote:
> On Wednesday 09 December 2009 11:21:40 am Tim Roberts wrote:
>
>> 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.
If you ran makepy, it should be in the generated code. It's handled by
DispatchItem in build.py; if it sees a call to a function that starts
with Set or Get, and there happens to be a property that matches the
rest of the name, it does the Right Thing.
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the python-win32
mailing list