D
Designingsally
i m trying to highlight a word "names" in a list.
I have three names:
Sally
Roger
Steve
The macros highlight the whole of "I have three names:" But i want only Name
to be highlighted. Is it possible?
macro i m tryin with is
Sub rs()
Dim lList As Long
Dim oRng As Range
For lList = ActiveDocument.Lists.Count To 1 Step -1
Set oRng = ActiveDocument.Lists(lList).ListParagraphs(1).Range
With oRng
If InStr(1, .Text,"names") Then
.Collapse Direction:=wdCollapseStart
.MoveStart Unit:=wdSentence, Count:=-1
.MoveEnd Unit:=wdCharacter, Count:=-1
If .Characters.Last <> ":" Then
.InsertAfter Text:=":"
End If
ActiveDocument.comments.Add Range:=oRng, Text:="AVOID"
End If
End With
Next lList
End Sub
I have three names:
Sally
Roger
Steve
The macros highlight the whole of "I have three names:" But i want only Name
to be highlighted. Is it possible?
macro i m tryin with is
Sub rs()
Dim lList As Long
Dim oRng As Range
For lList = ActiveDocument.Lists.Count To 1 Step -1
Set oRng = ActiveDocument.Lists(lList).ListParagraphs(1).Range
With oRng
If InStr(1, .Text,"names") Then
.Collapse Direction:=wdCollapseStart
.MoveStart Unit:=wdSentence, Count:=-1
.MoveEnd Unit:=wdCharacter, Count:=-1
If .Characters.Last <> ":" Then
.InsertAfter Text:=":"
End If
ActiveDocument.comments.Add Range:=oRng, Text:="AVOID"
End If
End With
Next lList
End Sub