Accessing Microsoft Word from Python

Josiah Carlson jcarlson at nospam.uci.edu
Fri Jan 23 03:40:59 EST 2004


Mickel Grönroos wrote:
> Hi!
> 
> I'm fiddling with Python for Windows (normally using Linux) and as a part
> of that I want to try to make a simple word frequency list generator to be
> used in conjunction with Microsoft Word. Does anybody have any good
> pointers on where I can find information about accessing Word-documents
> (or other Microsoft Office applications) from Python? To be more specific,
> I want to be able to:
> 
> - get the text content of the full Word document
> - define a callback in Python that is called every time a user enters a
> character into the text of a Word document
> - get the last two graphical word tokens before the current position of
> the insertion cursor in the text of the Word document.
> 
> Cheers!
> 
> /Mickel

Mickel,

Sounds like something that could be done with VB.  VB will let you 
script anything in Word or Office, but then it requires you to learn the 
horror that is VB.  Perhaps a limited interface is available through 
COM, but I wouldn't bet the farm on it.

  - Josiah



More information about the Python-list mailing list