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 / June 2005

Tip: Looking for answers? Try searching our database.

detecting end of document / Find command

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
troubadour - 24 Jun 2005 17:25 GMT
Is there a general way in a macro to detect that the end of the document is
reached ?
Actually i am trying to do so that a Find command automaticaly stops at the
end of the document (not trying to do the same search from the top of my
document, that becomes completely messed up :-)

Thank you

Troubadour
Doug Robbins - 24 Jun 2005 19:49 GMT
Like this

' Macro to round all numbers in a document

' Macro created 19/7/00 by Doug Robbins

'

Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
   Do While .Execute(FindText:="[0-9]{1,}.[0-9]{3,}", MatchWildcards: =
True, Wrap:=wdFindContinue, Forward:=True) = True
       Selection.Range.Text = Round(Selection.Range.Text, 2)
   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

> Is there a general way in a macro to detect that the end of the document
> is
[quoted text clipped - 7 lines]
>
> Troubadour
 
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.