J
jerem
Hi,
Trying to create a macro through keystrokes that does this:
finds text: bbb*bbb, Wildcards on
replaces text: ^& (with whatever it found)
then bold the replacement
Seems simple enough to me and when I do the keystrokes while recording it
does exactly what I want it to do, but it won't do it when I run the macro.
This is the code that gets recorded:
Sub Macro2()
'
'
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "bbb*bbb"
.Replacement.Text = "^&"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
I've fooled around with placing the statement: Selection.Font.Bold =
wdToggle in various spots, but that doesn't work either.
Any ideas, suggestions, etc.
Thanks in advance.
Trying to create a macro through keystrokes that does this:
finds text: bbb*bbb, Wildcards on
replaces text: ^& (with whatever it found)
then bold the replacement
Seems simple enough to me and when I do the keystrokes while recording it
does exactly what I want it to do, but it won't do it when I run the macro.
This is the code that gets recorded:
Sub Macro2()
'
'
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "bbb*bbb"
.Replacement.Text = "^&"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
I've fooled around with placing the statement: Selection.Font.Bold =
wdToggle in various spots, but that doesn't work either.
Any ideas, suggestions, etc.
Thanks in advance.