Where is Word?

Tomasz Lisowski tomlis at notmyisp.pl
Tue Jun 14 08:18:00 EDT 2005


> Thanks, but could you pretty please post some code that does this? I'm new 
> to Python, let alone COM..
> 
> TIA,
> g

import win32com.client
wordCOMID = "Word.Application"

word = win32com.client.Dispatch(wordCOMID)

Then you can use the methods of the word object, provided by the COM 
object definition. Unfortunately I don't know them - you may do a 
research by making a reference to the Microsoft Word type library in 
Visual Basic, declaring the variable of type Word.Application, and then 
watching the code assistant showing the available methods and 
properties. You may also use the object browser.

Tomasz Lisowski

> 
> "Tomasz Lisowski" <tomlis at notmyisp.pl> schreef in bericht 
> news:42aeae07 at news.home.net.pl...
> 
>>You may try to launch Word as a COM object and control it directly from 
>>Python using the COM object methods. This does not require you to know the 
>>application's path, only the COM object identifier.
>>
>>TLis 
> 
> 
> 



More information about the Python-list mailing list