how to move sequentially thru text

C

Chuck

I have need for walking thru the text of a document sequentially and add
info to each line as a function of its position in the document. In Access
one can use a recordset or load a recordset into an array, operate on the
array, and then write it back out. How does one do it in Word VBA?

Chuck
 
J

Jezebel

You can iterate the contents of the document in any number of ways,
depending on how much detail you need. The available collections are:
character, word, sentence, paragraph. But not Line. The code might be
something like

Dim pWord as Word.Range
For each pWord in ActiveDocument.Words
....

Next
 
C

Chuck

Thanks, Jezebel. That's what I needed. Don't need to iterate on a line but
on a paragraph.

Chuck
 

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