[python-win32] translating VB into Python...

Michael March mmarch at gmail.com
Fri May 11 03:23:31 CEST 2007


Cool..

The docs have this:

Public Property Field( _
   ByVal FieldName As String _
) As Variant

Can we infer the default property from this?


On 5/10/07, Tim Roberts <timr at probo.com> wrote:
> Michael March wrote:
> > I have some sample code with this:
> >
> >    object.Field("UserDefined_01") = "Open"
> >
> > Python barfs on that.. what would be the equivalent of that in Python?
> >
>
> Usually:
>     object.Field("UserDefined_01").Value = "Open"
>
> VB has the concept of a "default property" for a collection like this.
> Python's COM doesn't.  Unfortunately, every object has it's own "default
> property", so you sometimes have to refer to documentation to figure out
> what it is.
>
> --
> Tim Roberts, timr at probo.com
> Providenza & Boekelheide, Inc.
>
> _______________________________________________
> Python-win32 mailing list
> Python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
>


-- 
<admiral>

Michael F. March ----- mmarch at gmail.com
Ph: (415)462-1910 ---- Fax: (602)296-0400
P.O. Box 2254 ---- Phoenix, AZ 85002-2254
          "Seriously" - HSR


More information about the Python-win32 mailing list