FirstLetterExceptions 集合对象

         
Application
AutoCorrect
FirstLetterExceptions (FirstLetterException)

FirstLetterException 对象所组成的集合,该集合中的对象代表不用进行自动更正的缩写。

注意   如果将 CorrectSentenceCaps 属性设为 True,则句号后的第一个字符将自动大写。FirstLetterExceptions 集合中包含不用进行该操作的例外项(例如“addr.”和“apt.”之类的缩写)。

使用 FirstLetterExceptions 集合

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) 可返回单个的 FirstLetterException 对象,其中 index 是缩写或索引序号。下列示例从 FirstLetterExceptions 集合中删除缩写“appt.”。

AutoCorrect.FirstLetterExceptions("appt.").Delete

下列示例显示 FirstLetterExceptions 集合中首项的名称。

MsgBox AutoCorrect.FirstLetterExceptions(1).Name