Recheck the document for writing not the same code as the VBA code

I want to repeat the spell check in the document after adding the dictionary. The problem is the following code (mainly from a macro recorder)

CustomDictionaries.Add FileName:="c:\test_dictionary.dic"

Application.ResetIgnoreAll
ActiveDocument.Range.SpellingChecked = False
ActiveDocument.Range.GrammarChecked = False

does not give the same results as in Word Word Options | Proofing | Recheck Document . The button double-checks the document, and you can see that recently added words are deleted as spelling errors. The code has no noticeable effect.

What am I missing?

+3
source share
2 answers

Word. CustomDictionary , . "" (.. " ", "", ). - , (, ). . , , , .

, . (. SendKeys Vista/7, ). , , "". , , , .

+1

, :

 'spellcheck the document
 ActiveDocument.Range.LanguageID = wdFrenchHaiti
 ActiveDocument.Range.LanguageID = wdEnglishUS

, Word .

+1

Source: https://habr.com/ru/post/1757685/


All Articles