Format a Range : Word Format « Word « VBA / Excel / Access / Word






Format a Range

 
Sub ChangeFormat()
    Dim wdApp As Word.Application
    Dim wdRng As Word.Range
    Dim count As Integer
    
    Set wdApp = GetObject(, "Word.Application")
    
    With wdApp.ActiveDocument
        For count = 1 To .Paragraphs.count
            Set wdRng = .Paragraphs(count).Range
            With wdRng
                .Words(1).Font.Bold = True
            End With
        Next count
    End With
    
    Set wdApp = Nothing
    Set wdRng = Nothing
End Sub

 








Related examples in the same category

1.changing the formatting of entire paragraphs is to change the style