stevetalaga
11-23-2014, 07:03 AM
Can anybody give me a clue please how to replace all occurrences of a specific text string like this: [X]
with a Wingdings 2 symbol for the checked box (Character 83). I've tried this approach which doesn't work - It just gives me an "S" which is character 83 in a regular font:
With .Range.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "[X]"
.Replacement.Text = Chr(83)
.Replacement.Font.Name = "Wingdings 2"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute Replace:=wdReplaceAll
End With
I've also tried using the following approach but that gives the same results and doesn't replace every occurrence - I tried combining the 2 approaches but VB doesn't like the .InsertSymbol method with the "With Range.Find":
With Selection
.InsertSymbol CharacterNumber:=83, Font:="Wingdings 2"
End With
Thanks in advance.
with a Wingdings 2 symbol for the checked box (Character 83). I've tried this approach which doesn't work - It just gives me an "S" which is character 83 in a regular font:
With .Range.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "[X]"
.Replacement.Text = Chr(83)
.Replacement.Font.Name = "Wingdings 2"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute Replace:=wdReplaceAll
End With
I've also tried using the following approach but that gives the same results and doesn't replace every occurrence - I tried combining the 2 approaches but VB doesn't like the .InsertSymbol method with the "With Range.Find":
With Selection
.InsertSymbol CharacterNumber:=83, Font:="Wingdings 2"
End With
Thanks in advance.