J
jgc
hello
I am a novice so please bear with me...in a nutshell i am trying to auto
launch the search/replace dialog box in Word with the find text already
filled in. I think i am close but when i click replace all (without filling
in the replace with text box) and then close i receive runtime error 5524.
Any help would be greatly appreciated. I have included the code which may or
may not be helpful.
thanks in advance.
Sub autoopen()
MsgBox "When prompted please type the application name into the find/replace
window"
Call jenmacrolaunch
End Sub
Sub jenmacrolaunch()
'
' Macro1 Macro
' Macro recorded 4/5/2007 by Jennifer
'
Dialogs(wdDialogEditReplace).Show
Call jenmacro
End Sub
Sub jenmacro()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "appname"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
I am a novice so please bear with me...in a nutshell i am trying to auto
launch the search/replace dialog box in Word with the find text already
filled in. I think i am close but when i click replace all (without filling
in the replace with text box) and then close i receive runtime error 5524.
Any help would be greatly appreciated. I have included the code which may or
may not be helpful.
thanks in advance.
Sub autoopen()
MsgBox "When prompted please type the application name into the find/replace
window"
Call jenmacrolaunch
End Sub
Sub jenmacrolaunch()
'
' Macro1 Macro
' Macro recorded 4/5/2007 by Jennifer
'
Dialogs(wdDialogEditReplace).Show
Call jenmacro
End Sub
Sub jenmacro()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "appname"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub