Results 1 to 7 of 7

Thread: Macro to change all styles to a specific language

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,273
    Location
    Oops. I'd probably handle errors a little differently though:
    Sub ChangeStyle()
        Dim oDoc As Document, oSty As Style
        Set oDoc = ActiveDocument.AttachedTemplate.OpenAsDocument
        With oDoc
            For Each oSty In .Styles
                On Error Resume Next
                oSty.LanguageID = wdEnglishCanadian
                On Error GoTo 0
            Next
            .Close SaveChanges:=wdSaveChanges
        End With
        ActiveDocument.UpdateStyles
    End Sub
    Last edited by Aussiebear; 01-26-2025 at 11:42 AM.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •