I am looking for a macro for word documents that will find every style in a document, and change it from whatever it is开发者_StackOverflow (centered, justified, right-align) to left-align.
I don't want to change the text (except as a by-product), but the style itself so everything updates.
Thanks Remou, I tried working with it, and this seems to work:
Sub ChangeStyles()
Dim oSource As Document
Set oSource = ActiveDocument
For i = 1 To oSource.Styles.Count
' must check the style type as character style gives an error
If oSource.Styles(i).Type = wdStyleTypeParagraph Then
With ActiveDocument.Styles(i).ParagraphFormat
.Alignment = wdAlignParagraphLeft
End With
Else
End If
Next i
End Sub
精彩评论