saying "no" programmatically

L

Lighthouse

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
 
L

Lighthouse

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
 

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