Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make the first letter bold on each sentence in MS Word document

Tags:

ms-word

vba

I'd like to make first letter on each sentence bold in a MS Word document. What would be a good way to accomplish this?

like image 407
donny Avatar asked Jun 22 '10 19:06

donny


1 Answers

Pretty straight-forward in VBA

Sub BoldFirstLetterInSentence()
Dim ad As Document
Set ad = ActiveDocument
Dim sen As Range
For Each sen In ad.Sentences
    sen.Words.First.Characters.First.Font.Bold = True
    /* sen.Words(1).Characters(1).Font.Bold = True also works */
Next
End Sub
like image 66
Todd Main Avatar answered Oct 19 '22 01:10

Todd Main