View Single Post
 
Old 06-01-2025, 03:07 PM
Charles Kenyon Charles Kenyon is offline Windows 11 Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,461
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Please read the linked threads.

See Install/Employ VBA Procedures (Macros) by Greg Maxey.

Here is a macro that will change the language setting for everything in a document to English UK:



Code:
Sub ProofingLanguageEnglishUKAllStory()    ' based on field updater by Greg Maxey
    ' https://gregmaxey.com/word_tip_pages/word_fields.html
    ' Charles Kenyon 6 November 2018
    ' https://answers.microsoft.com/en-us/msoffice/forum/all/force-all-documents-to-be-edited-in-uk-english/df6d1f8e-5426-49d9-bea0-5620d0208294
    ' Changes proofing language to English UK in all stories of document
    ' Language IDs https://docs.microsoft.com/en-us/office/vba/api/word.wdlanguageid
    Dim rngStory As Word.range
    Dim lngValidate As Long    ' do not know purpose of this
    Dim oShp   As Shape
    Let lngValidate = ActiveDocument.Sections(1).Headers(1).range.StoryType
    For Each rngStory In ActiveDocument.StoryRanges
        'Iterate through all linked stories
        Do
            On Error Resume Next
            Let rngStory.LanguageID = wdEnglishUK
            Select Case rngStory.StoryType
                Case 6, 7, 8, 9, 10, 11
                    If rngStory.ShapeRange.Count > 0 Then
                        For Each oShp In rngStory.ShapeRange[/HTML]
                            If oShp.TextFrame.HasText Then
                                Let oShp.TextFrame.TextRange.LanguageID = wdEnglishUK
                            End If
                        Next
                    End If
                Case Else
                    'Do Nothing
            End Select
            On Error GoTo -1
            'Get next linked story (if any)
            Set rngStory = rngStory.NextStoryRange
        Loop Until rngStory Is Nothing
    Next
End Sub

You could attach the macro to a keyboard shortcut or a QAT button if you want.
Reply With Quote