![]() |
#31
|
|||
|
|||
![]()
Thank you Andrew. I hope it helps Metta. It works for me here.
I've added a link to this thread in my article on the Microsoft Answers site: Proofing Language Keeps Changing - Solutions - How can I keep my proofing language from changing? That article also contains code to change paragraph, character, and linked styles. I keep a repository of code snippets in my Normal.dotm. I've added your macro to my own repository of code, I added some comments. Code:
Sub SetLanguage() ' Changes all content and styles in the document to UK English spelling ' Andrew Lockton 2025-June-18 ' https://www.msofficeforums.com/186297-post30.html ' ' Only handles main story but also handles styles ' Does not change language in a blank document, needs some text ' Dim aStyle As Style, iLingua As Integer ' Pick a language constant - this is set for English UK ' Language IDs https://docs.microsoft.com/en-us/office/vba/api/word.wdlanguageid ' iLingua = wdEnglishUK ' ' CYCLE THROUGH PARAGRAPH STYLES AND SET LANGUAGE For Each aStyle In ActiveDocument.Styles If aStyle.Type = wdStyleTypeParagraph Then aStyle.LanguageID = iLingua End If Next aStyle ' APPLY LANGUAGE TO TEXT ALREADY IN DOCUMENT MAIN LAYER ' SET TEXT AS NOT CHECED YET ' TURN OFF ANY SETTING TO NOT CHECK SPELLING AND GRAMMAR ' With ActiveDocument .range.LanguageID = iLingua .range.NoProofing = False .SpellingChecked = False .GrammarChecked = False '.CheckSpelling ' CAN TURN THIS ON BY REMOVING FIRST COMMENT APOSTROPHE End With ' ' CLEAR LIST OF WORDS PREVIOUSLY SET TO BE IGNORED DURING A SPELL CHECK Application.ResetIgnoreAll End Sub Private Sub StyleEnglishUK() ' Written 21 March 2018 ' Charles Kenyon ' Intended to set all styles to EnglishUK, proofing, not automatitically update ' Language IDs https://docs.microsoft.com/en-us/office/vba/api/word.wdlanguageid ' Dim aStyle As Style On Error Resume Next ' Some styles have no language attribute and will give an error For Each aStyle In ActiveDocument.Styles Select Case aStyle.NameLocal Case "TOC 1", "TOC 2", "TOC 3", "TOC 4", "TOC 5", "TOC 6", "TOC 7", "TOC 8", "TOC 9", _ "Table of Figures", "Table of Authorities" Let aStyle.AutomaticallyUpdate = True Case Else Let aStyle.AutomaticallyUpdate = False End Select Let aStyle.LanguageID = wdEnglishUK Let aStyle.NoProofing = False Next aStyle Let ActiveDocument.UpdateStylesOnOpen = False ' For information on using this line, see: ' http://www.shaunakelly.com/word/sharing/willmyformatchange.html On Error GoTo -1 End Sub |
#32
|
|||
|
|||
![]()
Thank you Guessed and Charles Kenyon for all your help. I have kept the last code snippet you sent me and tried it. It ran through word with no syntax errors showing up, but it didn't do anything to change the US English to UK English. I also keep any code snippets I come across that are useful to me. I know very little about using computers, and macros are new to me. I tried to explain where the syntax errors occurred on the original macro Charles sent me, lines 2 and 19, because the print screen button on my lap top didn't take a photo shot of my screen for me to send.
Metta |
#33
|
|||
|
|||
![]()
You could always download a trial copy of Snagit from Techsmith.
Neither macro will change the language settings at the cursor of a blank document. |
#34
|
|||
|
|||
![]()
Just use the Windows Snipping Tool which can be launched with the shortcut Windows + Shift + S
|
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
KDuncan | Word | 1 | 01-16-2025 10:25 PM |
Not Changing Fonts From English to Non-English. | mohsen.amiri | Word | 0 | 07-31-2017 01:38 AM |
Finding Non-English Words in an English and Non-English words document | mohsen.amiri | Word | 3 | 03-31-2015 11:20 PM |
Word version doesn't have US English. | traumatiziert | Word | 1 | 04-20-2012 02:20 AM |
![]() |
tutwelve | Office | 7 | 08-20-2005 07:55 AM |