应用于 Application 和 Global 对象的 CheckSpelling 方法。
检查字符串的拼写错误。返回一个 Boolean 类型的值,以显示字符串是否包含拼写错误。如果字符串未包含拼写错误,则该值为 True。
expression.CheckSpelling(Word, CustomDictionary, IgnoreUppercase, MainDictionary, CustomDictionary2, CustomDictionary3, CustomDictionary4, CustomDictionary5, CustomDictionary6, CustomDictionary7, CustomDictionary8, CustomDictionary9, CustomDictionary10)
expression 必需。该表达式返回一个 Application 或 Global 对象。
Word String 类型,必需。要对其进行拼写检查的文本。
CustomDictionary Variant 类型,可选。返回 Dictionary 对象的表达式,或自定义词典的文件名。
IgnoreUppercase Variant 类型,可选。如果该参数值为 True,则忽略大小写。如果省略该参数,则使用 IgnoreUppercase 属性的当前值。
MainDictionary Variant 类型,可选。返回 Dictionary 对象的表达式,或主词典的文件名。
CustomDictionary2 — CustomDictionary10 Variant 类型,可选。返回 Dictionary 对象的表达式,或自定义附加词典的文件名。最多可以定义 9 个附加词典。
应用于 Document 和 Range 对象的 CheckSpelling 方法。
开始对指定的文档或区域进行拼写检查。如果该文档或区域中包含错误,则本方法显示“拼写和语法”对话框(单击“工具”菜单上的“拼写和语法”可显示该对话框),并清除“语法检查”复选框。该方法应用于文档时,将检查文档中所有有效文字的拼写(例如页眉、页脚和文本框)。
expression.CheckSpelling(CustomDictionary, IgnoreUppercase, AlwaysSuggest, CustomDictionary2, CustomDictionary3, CustomDictionary4, CustomDictionary5, CustomDictionary6, CustomDictionary7, CustomDictionary8, CustomDictionary9, CustomDictionary10)
expression 必需。该表达式返回一个 Document 或 Range 对象。
CustomDictionary Variant 类型,可选。返回 Dictionary 对象的表达式,或自定义词典的文件名。
IgnoreUppercase Variant 类型,可选。如果该参数值为 True,则忽略大小写。如果省略该参数,则使用 IgnoreUppercase 属性的当前值。
AlwaysSuggest Variant 类型,可选。如果该参数值为True,则 Microsoft Word 总是给出建议的拼写。如果忽略该参数,则使用 SuggestSpellingCorrections 属性的当前值。
CustomDictionary2 — CustomDictionary10 Variant 类型,可选。返回 Dictionary 对象的表达式,或自定义附加词典的文件名。最多可以定义 9 个附加词典。
本示例开始对活动文档中所有有效文字部分进行拼写检查。
Set range2 = Documents("MyDocument.doc").Sections(2).Range
range2.CheckSpelling IgnoreUpperCase:=False, _
CustomDictionary:="MyWork.Dic", _
CustomDictionary2:="MyTechnical.Dic"