J
Jake
I'm using a range in the following code to highlight the first sentence of
each paragraph. Since the first sentence in a one-sentence paragraph (such as
each item in a list) is the entire paragraph, this code of course also
highlights every one sentence paragraph. Is there a way to use the count
parameter to limit the search and replace to only paragraphs that have more
than one sentence?
The current code:
Private Sub CommandButton37_Click()
'Highlight first sentence of each para.
Dim oPar As Paragraph
Dim oRng As Word.Range
For Each oPar In ActiveDocument.Range.Paragraphs
oPar.Range.Sentences.First.HighlightColorIndex = wdWhite
Next oPar
End Sub
each paragraph. Since the first sentence in a one-sentence paragraph (such as
each item in a list) is the entire paragraph, this code of course also
highlights every one sentence paragraph. Is there a way to use the count
parameter to limit the search and replace to only paragraphs that have more
than one sentence?
The current code:
Private Sub CommandButton37_Click()
'Highlight first sentence of each para.
Dim oPar As Paragraph
Dim oRng As Word.Range
For Each oPar In ActiveDocument.Range.Paragraphs
oPar.Range.Sentences.First.HighlightColorIndex = wdWhite
Next oPar
End Sub