> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:python-win32- > [EMAIL PROTECTED] On Behalf Of Tim Roberts > Sent: Wednesday, January 02, 2008 4:56 PM > To: Python-Win32 List > Subject: Re: [python-win32] win32com- Type mismatch on a string... > Possible hash key collision? > > > > Actually, the 2nd Fields is an IList object which contains a list of > TDFields. I'm not 100% sure what the interface to an IList is, but you > might try ["BUG"] instead of ("BUG").
("BUG"), ["BUG"], and (["BUG"]) all fail with the same type mismatch error. Why would I need to use tuple and/or array syntax to walk a list? I'm expecting self.tdc.Customization.Fields.Fields("BUG") to simply return a list that I can iterate over. self.tdc.Customization.Fields is Public Property Fields() As Object self.tdc.Customization.Fields.Fields is Public Property Fields( Optional ByVal TableName As String = "" ) As List Remarks If an empty string is passed as TableName, returns a list of the fields in all tables List has Count and Item methods. I may be a Python newbie but it shouldn't be this difficult to walk a list. By comparison, here's the Perl equivalent: my $custFields = $tdc->Customization->Fields->Fields($db); for(my $i=1; $i<=$custFields->Count; $i++) { my $field = $custFields->Item($i); ... } _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32