Programmer_n
04-18-2016, 08:19 PM
Hi,
Recently, I was thinking of creating a Main clause and subordinate clause highlighter. Although the idea is crude. I want to highlight the sentence preceding ; in green color and sentence succeeding ; till the end of the sentence in say yellow color.
It seems word is able to identify a sentence till the arrival of a full stop.
Sub Macro2()
Selection.MoveRight Unit:=wdSentence, Count:=1, Extend:=wdExtend
End Sub
This code selects the sentences from mouse pointer to till end of a sentence. But it doesn't sense the ;
Sub s()
With Selection
.Extend
.Find.Text = "[;" & "]"
.Find.MatchWildcards = True
.Find.Execute
.Find.Text = "[." & "]"
.Find.Execute
End With
End Sub
Any help please.
Recently, I was thinking of creating a Main clause and subordinate clause highlighter. Although the idea is crude. I want to highlight the sentence preceding ; in green color and sentence succeeding ; till the end of the sentence in say yellow color.
It seems word is able to identify a sentence till the arrival of a full stop.
Sub Macro2()
Selection.MoveRight Unit:=wdSentence, Count:=1, Extend:=wdExtend
End Sub
This code selects the sentences from mouse pointer to till end of a sentence. But it doesn't sense the ;
Sub s()
With Selection
.Extend
.Find.Text = "[;" & "]"
.Find.MatchWildcards = True
.Find.Execute
.Find.Text = "[." & "]"
.Find.Execute
End With
End Sub
Any help please.