A
April
I am attempting to convert "greater than" and "less than" underlined symbols
to "greater than or equal to" and "less than or equal to" symbols in Word
2003. When I record a macro, the process works fine. It converts the
underlined greater/less than symbols to the correct one and leaves the not
underlined greater/less than symbols alone and gets rid of the underlining.
However, when I test the macro, it changes both the underlined symbol and the
not underlined symbol and converts it to the greater/less than or equal to
symbol, AND leaves the underlining. What can I do to ensure it only converts
the symbol that is underlined and leaves the not underlined symbol alone, and
gets rid of the underlining?
Here is the code the recorder came up with:
Sub Test11()
'
' Test11 Macro
' Macro recorded 3/27/2008 by nc6404
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ">"
.Replacement.Text = ChrW(8805)
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
I've tried inserting some font.underline code to the mix, but that doesn't
work either:
Sub Test8()
'
' Test7 Macro Edit
' Macro recorded 3/27/2008 by nc6404
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ">"
.Font.Underline = wdUnderlineSingle
.Replacement.Text = ChrW(8805)
.Font.Underline = wdUnderlineNone
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Any ideas will be greatly appreciated.
to "greater than or equal to" and "less than or equal to" symbols in Word
2003. When I record a macro, the process works fine. It converts the
underlined greater/less than symbols to the correct one and leaves the not
underlined greater/less than symbols alone and gets rid of the underlining.
However, when I test the macro, it changes both the underlined symbol and the
not underlined symbol and converts it to the greater/less than or equal to
symbol, AND leaves the underlining. What can I do to ensure it only converts
the symbol that is underlined and leaves the not underlined symbol alone, and
gets rid of the underlining?
Here is the code the recorder came up with:
Sub Test11()
'
' Test11 Macro
' Macro recorded 3/27/2008 by nc6404
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ">"
.Replacement.Text = ChrW(8805)
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
I've tried inserting some font.underline code to the mix, but that doesn't
work either:
Sub Test8()
'
' Test7 Macro Edit
' Macro recorded 3/27/2008 by nc6404
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ">"
.Font.Underline = wdUnderlineSingle
.Replacement.Text = ChrW(8805)
.Font.Underline = wdUnderlineNone
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Any ideas will be greatly appreciated.