T
Thomas M.
Word 2003
I have the following simple macro.
Sub GreenFont()
If Selection.Start = Selection.End Then
Selection.MoveUp Unit:=wdParagraph, Count:=1
Selection.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdExtend
Selection.Font.Color = wdColorGreen
Selection.MoveUp Unit:=wdParagraph, Count:=1
Else
Selection.Font.Color = wdColorGreen
End If
End Sub
If text is selected in the document the entire selection is turned to green
text. Otherwise, the current paragraph is turned to green text. This works
well with one exception--if the insertion point is at the start of the
paragraph it will act on the *previous* paragraph. What is the easiest way
to make it always act on the current paragraph--without regard to the
position of the insertion point--when text is not selected?
--Tom
I have the following simple macro.
Sub GreenFont()
If Selection.Start = Selection.End Then
Selection.MoveUp Unit:=wdParagraph, Count:=1
Selection.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdExtend
Selection.Font.Color = wdColorGreen
Selection.MoveUp Unit:=wdParagraph, Count:=1
Else
Selection.Font.Color = wdColorGreen
End If
End Sub
If text is selected in the document the entire selection is turned to green
text. Otherwise, the current paragraph is turned to green text. This works
well with one exception--if the insertion point is at the start of the
paragraph it will act on the *previous* paragraph. What is the easiest way
to make it always act on the current paragraph--without regard to the
position of the insertion point--when text is not selected?
--Tom