smileyface5
Feb 28th, 2005, 07:44 PM
how do i select text around the selected text so that all the text coloured in a certain colour is selected.
For example the cursor is placed in the middle of a word and i want all of that word and all the words around that word that are coloured in the same colour to be selected.
here is the code i am using to do the same to select an entire word:
With Selection
.Expand wdWord
Do While Right(.Text, 1) = Chr(32)
.MoveLeft Unit:=wdCharacter, count:=1, Extend:=wdExtend
Loop
selWord$ = Trim(.Text)
End With
now i want to select an entire phrase in the same colour
what changes do i have to make
For example the cursor is placed in the middle of a word and i want all of that word and all the words around that word that are coloured in the same colour to be selected.
here is the code i am using to do the same to select an entire word:
With Selection
.Expand wdWord
Do While Right(.Text, 1) = Chr(32)
.MoveLeft Unit:=wdCharacter, count:=1, Extend:=wdExtend
Loop
selWord$ = Trim(.Text)
End With
now i want to select an entire phrase in the same colour
what changes do i have to make