FirstLetterExceptions 对象 (Word)

代表被自动更正的缩写的 FirstLetterException 对象的集合。

备注

下一段的第一个字符是自动改为大写时的 CorrectSentenceCaps 属性设置为 TrueFirstLetterExceptions 集合包含此行为的例外(例如,缩写“addr.”和“apt.”)。

可以使用 FirstLetterExceptions 属性返回 FirstLetterExceptions 集合。 如果 FirstLetterExceptions 集合中包含缩写“addr.”,则以下示例将其从中删除。

For Each aExcept In AutoCorrect.FirstLetterExceptions 
 If aExcept.Name = "addr." Then aExcept.Delete 
Next aExcept

以下示例创建一篇新文档,然后在其中插入所有自动更正的首字母例外项。

Documents.Add 
For Each aExcept In AutoCorrect.FirstLetterExceptions 
 With Selection 
 .InsertAfter aExcept.Name 
 .InsertParagraphAfter 
 .Collapse Direction:=wdCollapseEnd 
 End With 
Next aExcept

使用 Add 方法可向首字母异常列表添加缩写。 以下示例在该列表中添加缩写“addr.”。

AutoCorrect.FirstLetterExceptions.Add Name:="addr."

使用 FirstLetterExceptions (Index) (其中 Index 是缩写或索引号)可返回单个 FirstLetterException 对象。 以下示例从 FirstLetterExceptions 集合中删除缩写“appt.”。

AutoCorrect.FirstLetterExceptions("appt.").Delete

下面的示例显示 FirstLetterExceptions 集合中的第一项的名称。

MsgBox AutoCorrect.FirstLetterExceptions(1).Name

另请参阅

Word 对象模型参考

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。