I tried to use the sample code to print a webpage via ie and I get the following error:
Traceback (most recent call last): File "C:\Python25\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py" , line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\ie.py", line 14, in <module> ie.ExecWB(win32com.client.constants.OLECMDID_PRINT, win32com.client.constants.OLECMDEXECOPT_DONTPROMPTUSER) NameError: name 'win32com' is not defined I have the win32com module installed and I clicked on makepy.py and selected Microsoft Internet Controls (1.1). The code was: from win32com.client import Dispatch from time import sleep ie = Dispatch("InternetExplorer.Application") ie.Visible = 1 ie.Navigate("http://www.cnn.com" <http://www.cnn.com%22> ) if ie.Busy: sleep(2) # print the current IE document without prompting the user for the printerdialog ie.ExecWB(win32com.client.constants.OLECMDID_PRINT,win32com.client.const ants .OLECMDEXECOPT_DONTPROMPTUSER) Why am I getting this error?
-- http://mail.python.org/mailman/listinfo/python-list