[Tutor] closing a internet explorer com object

John Fouhy john at fouhy.net
Wed Jun 25 00:02:09 CEST 2008

On 25/06/2008, Jeff Peery <jeffpeery at yahoo.com> wrote:
> hello,
> I'm using internet explorer to print out html documents and I'm not sure how
> to close it once it is created. How do I do this? below is the simple bit of
> code I use to print documents.
>         ie =
> win32com.client.Dispatch("InternetExplorer.Application")

You may be able to call ie.Close(True) or ie.Exit(True) or something
like that -- I'm not sure.  If you run the MakePy utility (from the
pythonwin tools menu, or just run the script) it will generate python
code that includes effectively method signatures for the different COM
objects you can control.  By inspecting this, you may be able to learn
what methods you can call on InternetExplorer.Application objects and
what arguments you need to give them.


More information about the Tutor mailing list