Recheck Document For Spellings Not Same as VBA Code

前端 未结 2 805
梦如初夏
梦如初夏 2021-01-13 23:17

I want to recheck the spellings in a document after adding a dictionary. The problem is the following code (mostly from the macro recorder)

CustomDictionarie         


        
2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-13 23:54

    I've had to do the same thing for a project, an this workaround made it happen for me:

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

    When you change the language, Word rechecks the range for spelling errors.

提交回复
热议问题