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

Tip: Looking for answers? Try searching our database.

saying "no" programmatically

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lighthouse - 21 Mar 2005 22:15 GMT
I recorded a macro that selects my whole document and does a
search/replace, another search/replace, then an update all fields. when
the macro runs on an "autonew" i get a dialog box asking me if I want
to "search the rest of the document -- yes/no" after each of the
search/replace routines.

How do I make the macro answer "no" automatically and unselect my
document when the macro is done running? TIA
Chuck - 22 Mar 2005 16:09 GMT
If you post the code it may be easier to see what's going wrong.  

> I recorded a macro that selects my whole document and does a
> search/replace, another search/replace, then an update all fields. when
[quoted text clipped - 4 lines]
> How do I make the macro answer "no" automatically and unselect my
> document when the macro is done running? TIA
Lighthouse - 23 Mar 2005 21:01 GMT
this is my code:

Sub killtrailsp()
'
' killtrailsp Macro
' Macro recorded 3/21/2005
' this macro is used to eliminate extraneous
' spaces inserted w/ bookmarks and x-refs and
' to ensure all x-refs are updated
'
   Selection.WholeStory
   Selection.Find.ClearFormatting
   Selection.Find.Replacement.ClearFormatting
   With Selection.Find
       .Text = " ^p"
       .Replacement.Text = "^p"
       .Forward = True
       .Wrap = wdFindAsk
       .Format = False
       .MatchCase = False
       .MatchWholeWord = False
       .MatchWildcards = False
       .MatchSoundsLike = False
       .MatchAllWordForms = False
   End With
   Selection.Find.Execute Replace:=wdReplaceAll
'   Selection.Fields.Update
'   ActiveWindow.ActivePane.LargeScroll Down:=5
   Selection.Find.ClearFormatting
   Selection.Find.Replacement.ClearFormatting
   With Selection.Find
       .Text = " , "
       .Replacement.Text = ", "
       .Forward = True
       .Wrap = wdFindAsk
       .Format = False
       .MatchCase = False
       .MatchWholeWord = False
       .MatchWildcards = False
       .MatchSoundsLike = False
       .MatchAllWordForms = False
   End With
   Selection.Find.Execute Replace:=wdReplaceAll
   Selection.Fields.Update
End Sub

Thanks for taking a look
 
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.