Remove final macro dialog

L

livetohike

Outlook 2000
The following macro woks great on the selected text except that after
it runs it displays the following message:

"Word has finished searching the selection. 2 replacements were
made. Do you want to search the remainder of the document?" Yes / No

How can I get rid of this? I just want it to act on the selected text
w/o this dialog box at the end. Yes, I know I can just click on "No"
but that does not seem very clean.
Thanks

Sub ConvertWrap()
With Selection.Find
.Text = "([!^013])^013([!^013^t])"
.Replacement.Text = "\1^032\2"
.Forward = True
'.Wrap = wdFindContinue
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
End Sub
 
L

livetohike

Outlook 2000
The following macro woks great on the selected text except that after
it runs it displays the following message:

"Word has finished searching the selection. 2 replacements were
made. Do you want to search the remainder of the document?" Yes / No

How can I get rid of this? I just want it to act on the selected text
w/o this dialog box at the end. Yes, I know I can just click on "No"
but that does not seem very clean.
Thanks

Sub ConvertWrap()
With Selection.Find
.Text = "([!^013])^013([!^013^t])"
.Replacement.Text = "\1^032\2"
.Forward = True
'.Wrap = wdFindContinue
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
End Sub

I meant Word 2000
 
L

Lene Fredborg

Try to replace the line:
..Wrap = WdFindAsk

by the following line:
..Wrap = wdFindStop

Also see the VBA help on the Wrap property.

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


livetohike said:
Outlook 2000
The following macro woks great on the selected text except that after
it runs it displays the following message:

"Word has finished searching the selection. 2 replacements were
made. Do you want to search the remainder of the document?" Yes / No

How can I get rid of this? I just want it to act on the selected text
w/o this dialog box at the end. Yes, I know I can just click on "No"
but that does not seem very clean.
Thanks

Sub ConvertWrap()
With Selection.Find
.Text = "([!^013])^013([!^013^t])"
.Replacement.Text = "\1^032\2"
.Forward = True
'.Wrap = wdFindContinue
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
End Sub

I meant Word 2000
 

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