I'm looking for a quick way to index all words in a microsoft word document.
The indexer in word seems to be all manual. I tried a program to itterate
the word object model but it gives me only word and word number not page
number or paragraph number -- in fact I couldn't find page in the word
object model. Any ideas or code sample appreciated.
Page isn't itself in the object model, but you can get the page number of
any range -- including a word -- from the Range.Information property. So if
you wanted to build your own index you could use
Dim pWord as Word.Range
For each pWord in ActiveDocument.Words
... output pWord, pWord.Information(wdActiveEndPageNumber)
Next
> I'm looking for a quick way to index all words in a microsoft word document.
> The indexer in word seems to be all manual. I tried a program to itterate
> the word object model but it gives me only word and word number not page
> number or paragraph number -- in fact I couldn't find page in the word
> object model. Any ideas or code sample appreciated.