重新检查拼写与 VBA 代码不同的文档 [英] Recheck Document For Spellings Not Same as VBA Code

查看:32
本文介绍了重新检查拼写与 VBA 代码不同的文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在添加字典后重新检查文档中的拼写.问题是下面的代码(主要来自宏记录器)

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

CustomDictionaries.Add FileName:="c:	est_dictionary.dic"

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

不会产生与 Word 2007 的Word 选项|校对|重新检查文档按钮相同的结果.该按钮会重新检查文档,您可以看到新添加的单词作为拼写错误被删除.代码没有任何明显的影响.

does not produce the same results as from the Word 2007's Word Options|Proofing|Recheck Document button. The button does recheck the document and you can see the newly added words get removed as misspellings. The code does not have any noticable affect.

我忽略了什么?

推荐答案

我不得不为一个项目做同样的事情,这个解决方法让我做到了:

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

当您更改语言时,Word 会重新检查拼写错误的范围.

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

这篇关于重新检查拼写与 VBA 代码不同的文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆