Recheck Document For Spellings Not Same as VBA Code

前端 未结 2 780
梦如初夏
梦如初夏 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-14 00:20

    This is the way Word works. Adding a CustomDictionary will not trigger it to be used right away, there are only a few way ways to trigger it. One of which is the Proofing dialog (i.e. you don't have to click "Recheck Document", you just need to click "OK" and it will recheck). Another trigger is to manually type in text and then a seperator (like a space or paragraph). Yet another trigger is the Spell Check dialog. Unfortunately, there don't seem to be any really good options I can see.

    But here's a bad option, which I haven't tried. (Note: SendKeys doesn't work well on Vista/7, there is a replacement out there). After you've added your custom dictionary, bring up the proofing dialog and then programmatically click OK. Again, I haven't tried it really, so I'm not sure if this will produce the desired results.

提交回复
热议问题