boolean values in COM / VB / Python

Lloyd Kvam lloyd at venix.com
Mon Mar 26 19:42:30 EST 2001


My guess is that you don't have a COM wrapper in place for the Document.  In
other words:

import win32com.client
ie = win32com.client.Dispatch("InternetExplorer.Application")
ie.Visible = 1	# toggles window visible
ie.Visible = 0	# toggles window invisible
ie.GetHome()	# loads the home page

Now when you refer to
ie.Document	
you are actually referring to a new object.  I believe that you will need to do
some work to provide the wrapper so that Python values get translated to the
equivalent COM values.

"John J. Lee" wrote:
> 
> ie.Document.execCommand("SaveAs", false, pathname)
> 
> where ie is an Internet Explorer object, pops up a dialogue box, no matter
> what value for false I try, from (1==0, 0, "0", None). According to the MS
> docs at
> 
> http://msdn.microsoft.com/workshop/author/dhtml/reference/constants/saveas.asp
> 
> and
> 
> http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/execCommand.asp
> 
> this isn't supposed to happen, because when the second argument to
> execCommand is 'false', the command 'Does not display a user interface'.
> According to Mark Hammond just last month, 0 should do fine as a way of
> representing 'false':
> 
> http://groups.google.com/groups?hl=en&lr=&safe=off&ic=1&th=1cd0ed3943dead44&thn=Setting+boolean+COM+properties&seekd=926499672
> 
> Any clues as to what is happening?
> 
> Tips on the differences between C++ / VB and Python in general would also
> be appreciated -- presumably there must be some reliable and mechanical
> way of doing this?
> 
> John

-- 
Lloyd Kvam
Venix Corp.
1 Court Street, Suite 378
Lebanon, NH 03766-1358

voice:	603-443-6155
fax:	801-459-9582



More information about the Python-list mailing list