Word) (FirstLetterExceptions 物件
FirstLetterException 物件集合,代表從自動校正中排除的縮寫。
註解
當 CorrectSentenceCaps 屬性設定為 True 時,句點之後的第一個字元會自動變成大 寫。 FirstLetterExceptions 集合包含此行為的例外規則 (例如 "addr." 及 "apt." 等縮寫)。
使用 FirstLetterExceptions 屬性可傳回 FirstLetterExceptions 集合。 下列範例會在 "addr." 縮寫包含在 FirstLetterExceptions 集合中時,將其刪除。
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
請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。