Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2005

Tip: Looking for answers? Try searching our database.

repeat MS - Word Macro until end of document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mirko.pavlovski@gmail.com - 17 Oct 2005 14:05 GMT
Hello 2 All!
 I recorded a macro which does some search & replace to a whole
paragraph in a MS Word document.
Does anyone know how can I make that macro to repeat itself untill end
of line i.e. end of the word document.

The logic would be:

While not eof
do
execute macro
move 2 the next line/block od the word document
end while

Thanks.
Regards,
Doug Robbins - 17 Oct 2005 18:24 GMT
This is an example:

Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
   Do While .Execute(FindText:="MacWordNew", MatchWildcards:=False,
Wrap:=wdFindContinue, Forward:=True) = True
       Selection.Paragraphs(1).Range.Delete
   Loop
End With

Signature

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

> Hello 2 All!
>  I recorded a macro which does some search & replace to a whole
[quoted text clipped - 12 lines]
> Thanks.
> Regards,
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.