Python / COM / Word

Duncan Smith buzzard at urubu.freeserve.co.uk
Fri Mar 19 22:58:03 EST 2004


Hello,
         I'm having a little trouble trying to automate Word (2002).  I'm
hoping to be able to create and process documents relatively independently
of any existing open word documents.  e.g.  When I have an existing document
open and I enter the following at the command line any documents I create
are visible, until setting wordApp.Visible to False, when all the documents
are hidden.

>>> import win32com.client
>>> wordApp = win32com.client.Dispatch('Word.Application')
>>> wordApp.Visible
True
>>> wordApp.Visible = False

Ideally I'd like to have independent 'Word instances', so I can hack around
to my heart's content without jeopardising documents opened and created by
some hapless user (which would also be me).  At the very least I need to
keep the documents I'm creating hidden, whilst leaving existing documents
visible.  Any ideas?  Cheers.

Duncan





More information about the Python-list mailing list