Hi all,
I'm trying to build a macro in Word 2k that will replace certain text. I did a record macro and it built the macro and replaced the text, but when I run the macro, it doesn't do anything. The text I want to replace is in a Text Box... do you think that's the problem? Any help would be appreciated. Thanks. Here is the macro:
Sub ReplaceNum()
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "+"
.Replacement.Text = "1234567"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0 _
, PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0
End Sub
"One Database to rule them all, One Database to find them,
One Database to bring them all and in the darkness bind them."
I'm trying to build a macro in Word 2k that will replace certain text. I did a record macro and it built the macro and replaced the text, but when I run the macro, it doesn't do anything. The text I want to replace is in a Text Box... do you think that's the problem? Any help would be appreciated. Thanks. Here is the macro:
Sub ReplaceNum()
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "+"
.Replacement.Text = "1234567"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0 _
, PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0
End Sub
"One Database to rule them all, One Database to find them,
One Database to bring them all and in the darkness bind them."