while not "\EndOfDoc"

M

ME

I need to carry out some editing on the text of a document.
A macro will do well.
How can I repeat it until the end of the document?

I tried something like WHILE NOT "\EndOfDoc" but it did not work.
Any suggestions?

Thank you in advance
Carlos
 
D

Doug Robbins - Word MVP

You need to tell us exactly what you want to do.

You would normally do it with something like:

Dim DRange As Range
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="[A-Z]{2,}", MatchWildcards:=True,
Wrap:=wdFindContinue, Forward:=True) = True
Set DRange = Selection.Range
DRange.Case = wdTitleWord
Loop
End With

But, it depends what "it" is.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
M

ME

You would normally do it with something like:
....

Thank you for that code. It does help my case and I can forget the
"\EndOfDoc" bookmark.
But I would be interested in seeing an example (any code) using that
bookmark.

Thank you again
Carlos
 

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