我正在写一篇关于法语出版物的评论。我自己的文本是英文的,但我引用了很多法语,偶尔也会引用德语、希腊语和拉丁语文本。我小心翼翼地以标准方式“更改(选定文本)的校对语言”。在工作结束时,我关闭了文档。当我再次打开它时,一些非英语引文被标记为拼写错误,果然它们的校对语言已恢复为英语。
答案1
使用字符样式来确定校对语言的选择
正如 Harrymc 所建议的,关闭“自动检测语言”选项。
以下是链接我关于使用字符样式来校对语言选择的文章除了您的基本语言之外,还提供了其他语言。本文讨论了这种样式的使用方法以及如何手动创建这种样式,并提供了创建这种样式的宏和键盘快捷键。
这是该文章中展示的用于创建法语字符样式的宏。
Sub FrenchLanguageCharacterStyleCreate() ' SEE ALSO ASSIGNSHORTCUTFRENCHLANGUAGE FOLLOWING ' Charles Kenyon ' Creates a character style named "French Language" in the Active Document ' Does NOT apply the style to a selection, simply creates the style ' 18 March 2024 ' Language IDs [https://docs.microsoft.com/en-us/office/vba/api/word.wdlanguageid][2] ' Dim stlFrench As Style ' On Error GoTo ErrorAlreadyExists ' If doing something other than French, change the style name and the languageID throughout this macro Set stlFrench = ActiveDocument.Styles.Add(Name:="French Language", Type:=wdStyleTypeCharacter) On Error GoTo -1 With stlFrench .Font.Name = "" .LanguageID = wdFrench End With GoTo ExitSub ErrorAlreadyExists: MsgBox Prompt:="Style 'French Language' already exists", Buttons:=vbInformation, title:="Not Needed" ExitSub: Set stlFrench = Nothing End Sub Sub AssignShortcutFrenchLanguage() ' ' Charles Kenyon ---- GOES WITH PREVIOUS MACRO ' 26 October 2021 ' Assigns keyboard shortcut Ctrl+Shift+Alt+F to French Language style ' Style must exist ' Saves this shortcut in the active document ' CustomizationContext = ActiveDocument ' Change ActiveDocument to NormalTemplate if style is in Normal Template ' Change the wdKeyF to appropriate key if changing and use the style name used in the macro above for Command KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyF, wdKeyControl, _ wdKeyShift, wdKeyAlt), _ KeyCategory:=wdKeyCategoryStyle, _ Command:="French Language" ' Note, this must be the same name assigned in first macro. End Sub
看:从论坛或网站安装宏的说明 作者:Graham Mayor,MVP