COM lifetimes

Alex Martelli aleaxit at yahoo.com
Sat Apr 7 18:28:46 EDT 2001


"Volucris" <volucris at hotmail.com> wrote in message
news:3acf7e10$0$837$6e49188b at news.goldengate.net...
> When I do the following, Word doesn't close.
> >>> from win32com.client import Dispatch
> >>> w = Dispatch("Word.Application")
> >>> w.visible = 1
> >>> w = None
> I though python was to handle this. How do I close a COM object? I'm using
> PythonWin 2.0. Any ideas?

Word chooses not to terminate automatically if it is Visible; your script
can
still choose to terminate it explicitly by calling w.Quit().


Alex






More information about the Python-list mailing list