Analysing Word documents (slow) What's wrong with this code please!
daniel.dittmar at sap.com
Mon Jan 19 11:49:19 CET 2004
> Anyone has a hint how else to get faster results?
> (This is to find out what was bold in the document, in order to grab
> documents ptoduced in word and generate html (web pages) and xml
> (straight data) versions)
> for i in range(len(MSWord.Documents.Content.Text)):
> if MSWord.Documents.Range(i,i+1).Bold : # testing for bold
Perhaps you can search for bold text. The Word search dialog allows this.
And when you use the keybord macro recording feature of Word, you can
probably figure out how to use that search feature from Python.
More information about the Python-list