Indexing Automatically a document using VBA if necessary

G

Guest

Is there a way to index all words in a word document
automatically? VBA seems to expose a word model but not a
way to show which word to which page or which paragraph?
Does anyone have any sample code or how to do this? Its a
programing issue I think. Thanks.
 
C

Cindy M -WordMVP-

Is there a way to index all words in a word document
automatically? VBA seems to expose a word model but not a
way to show which word to which page or which paragraph?
Does anyone have any sample code or how to do this?
Nothing built into Word, but I think there may be
third-party programs out there that do this. I'd try asking
in the word.docmanagement newsgroup.

If you want to try this yourself, you could "walk" the
document. The following code picks up every word in the
current document and tells you the page number. This isn't
completely what you're looking for, but it would give you a
start.

Dim wrd As Word.Range

For Each wrd In ActiveDocument.Words
Debug.Print wrd.Text, _
wrd.Information(wdActiveEndPageNumber)
Next wrd

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun
8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top