D
Designingsally
I m reposting this again so that others benefit. This query is not closed yet.
every bullet or any list must have a lead in sentence as per the book. So
i wnt the macros to add : at the end of the lead in sentence. If the lead in
sentences has words like "various", "as follows" then i wan the macros to
identify the sentence and give a message saying AVOID. PLus, i wan the
macros to HIGHLIGHT THE WORD VARIOUS, AS FOLLOWS alone to be highlighted. I
dont want the macros to highlight the whole lead in.
Example:
I have a: (this is the lead in sentence, notice the end of the lead in
sentence has a COLON. And also every lead in sentence is followed by a list)
*Book
*Pen
*paper
thanks for any help that comes along. The macro below comments the entire
lead in sentence when the word various or as follows encounter. I wan that
particular to be highlighted alone
The macros i got is
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
.Collapse Direction:=wdCollapseStart
.MoveStart Unit:=wdSentence, Count:=-1
.MoveEnd Unit:=wdCharacter, Count:=-1
If .Characters.Last <> ":" Then
.InsertAfter Text:=":"
End If
If InStr(1, .Text, "various") Then
ActiveDocument.comments.Add Range:=oRng, Text:="AVOID"
If InStr(1, .Text, "as follows") Then
ActiveDocument.comments.Add Range:=oRng, Text:="AVOID"
End If
End If
End With
Next lList
every bullet or any list must have a lead in sentence as per the book. So
i wnt the macros to add : at the end of the lead in sentence. If the lead in
sentences has words like "various", "as follows" then i wan the macros to
identify the sentence and give a message saying AVOID. PLus, i wan the
macros to HIGHLIGHT THE WORD VARIOUS, AS FOLLOWS alone to be highlighted. I
dont want the macros to highlight the whole lead in.
Example:
I have a: (this is the lead in sentence, notice the end of the lead in
sentence has a COLON. And also every lead in sentence is followed by a list)
*Book
*Pen
*paper
thanks for any help that comes along. The macro below comments the entire
lead in sentence when the word various or as follows encounter. I wan that
particular to be highlighted alone
The macros i got is
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
.Collapse Direction:=wdCollapseStart
.MoveStart Unit:=wdSentence, Count:=-1
.MoveEnd Unit:=wdCharacter, Count:=-1
If .Characters.Last <> ":" Then
.InsertAfter Text:=":"
End If
If InStr(1, .Text, "various") Then
ActiveDocument.comments.Add Range:=oRng, Text:="AVOID"
If InStr(1, .Text, "as follows") Then
ActiveDocument.comments.Add Range:=oRng, Text:="AVOID"
End If
End If
End With
Next lList