I am trying to write a macro that will launch the EditReplace dialog in Word so that I can be sure that the previous settings in the dialog are erased each time I display the dialog. I recorded some code and add the Dialogs line below:
Sub CtrlQA()
'
' QuickReplace Macro
' Ctrl+Q, A -- Replace Dialog
'
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Dialogs(wdDialogEditReplace).Show
End Sub
However, the messages presented when the dialog is done are showing up as VBA errors instead of just the usual Word dialog on screen. It's like the .SHOW routine is keeping control of the dialog rather than ending the macro as soon as the dialog displays. Anybody know what code I'm missing to get this to work??
Thanks!!
-Rich



