PDA

View Full Version : Solved: Bold first and last sentence in each paragraph



eripple
11-17-2005, 10:39 AM
Is there a way to go through each paragraph in word document and bold the first and last sentences?


Thanks in advance!
E

fumei
11-17-2005, 11:27 AM
Sub FirstLastBold()
Dim oSentence As Word.Sentences
Dim oPara As Word.Paragraph
For Each oPara In ActiveDocument.Range.Paragraphs()
Set oSentence = oPara.Range.Sentences
oSentence(1).Font.Bold = True
oSentence.Last.Font.Bold = True
Set oSentence = Nothing
Next
End Sub
will bold the first and last sentences of each paragraph.

eripple
11-17-2005, 12:41 PM
Works like a charm! Thanks for the quick help.

eripple