M
Mark Tangard
The following code works in Word 2000, but when run in 2003 the first
part of the 'If' statement doesn't work; that is, existing highlight in
the paragraph is not removed.
If Selection.End = Selection.Start Then
Selection.Paragraphs(1).Range.HighlightColorIndex = wdNoHighlight
Else
Selection.Range.HighlightColorIndex = wdNoHighlight
End If
This rather strange and apparently wasteful variation is what works in
Word 2003:
Dim r as Range
If Selection.End = Selection.Start Then
For Each r In Selection.Paragraphs(1).Range.Characters
r.HighlightColorIndex = wdNoHighlight
Next
Selection.Paragraphs(1).Range.HighlightColorIndex = wdNoHighlight
Else
Selection.Range.HighlightColorIndex = wdNoHighlight
End If
Any idea why?
TIA
Mark Tangard
"Life is nothing if you're not obsessed." --John Waters
part of the 'If' statement doesn't work; that is, existing highlight in
the paragraph is not removed.
If Selection.End = Selection.Start Then
Selection.Paragraphs(1).Range.HighlightColorIndex = wdNoHighlight
Else
Selection.Range.HighlightColorIndex = wdNoHighlight
End If
This rather strange and apparently wasteful variation is what works in
Word 2003:
Dim r as Range
If Selection.End = Selection.Start Then
For Each r In Selection.Paragraphs(1).Range.Characters
r.HighlightColorIndex = wdNoHighlight
Next
Selection.Paragraphs(1).Range.HighlightColorIndex = wdNoHighlight
Else
Selection.Range.HighlightColorIndex = wdNoHighlight
End If
Any idea why?
TIA
Mark Tangard
"Life is nothing if you're not obsessed." --John Waters