View Single Post
 
Old 06-17-2025, 10:36 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

How about you try some alternate code instead. This macro is similar but differs in critical ways:
  1. The code Charles provided concentrates on different story ranges, mine only treats the main body of the document.
  2. The code Charles provided ignores style settings so future edits could easily introduce alternate languages once more
This alternative code could be adapted to include all story ranges if they were important to you but it is best to get something that works before making it too complex.
Code:
Sub SetLanguage()
  'Changes all content and styles in the document to UK English spelling
  Dim aStyle As Style, iLingua As Integer
  iLingua = wdEnglishUK
  For Each aStyle In ActiveDocument.Styles
    If aStyle.Type = wdStyleTypeParagraph Then
      aStyle.LanguageId = iLingua
    End If
  Next aStyle
  With ActiveDocument
    .Range.LanguageId = iLingua
    .Range.NoProofing = False
    .SpellingChecked = False
    .GrammarChecked = False
    '.CheckSpelling
  End With
  Application.ResetIgnoreAll
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote