代表视图中 AutoFormatRule 对象的集合。
备注
使用 Add 方法或 插入AutoFormatRules 集合的方法来创建新的格式设置规则为下列对象派生自的 视图 对象︰
AutoFormatRuleAutoFormatRules 集合中包含的对象应用到的顺序集合中包含的每个 Outlook 项目。 如果调用 SaveAutoFormatRules 集合的方法,对 AutoFormatRule 对象的更改将保留。
示例
下面的 Visual Basic for Applications (VBA) 示例枚举当前 表 对象, AutoFormatRules 集合禁用集合中包含的任何自定义格式设置规则。
Private Sub DisableCustomAutoFormatRules() 
 
 Dim objTableView As TableView 
 
 Dim objRule As AutoFormatRule 
 
 
 
 ' Check if the current view is a table view. 
 
 If Application.ActiveExplorer.CurrentView.ViewType = olTableView Then 
 
 
 
 ' Obtain a TableView object reference to the current view. 
 
 Set objView = Application.ActiveExplorer.CurrentView 
 
 
 
 ' Enumerate the AutoFormatRules collection for 
 
 ' the table view, disabling any custom formatting 
 
 ' rule defined for the view. 
 
 For Each objRule In objView.AutoFormatRules 
 
 If Not objRule.Standard Then 
 
 objRule.Enabled = False 
 
 End If 
 
 Next 
 
 
 
 ' Save and apply the table view. 
 
 objView.Save 
 
 objView.Apply 
 
 End If 
 
End Sub 
 
方法
| 名称 | 
|---|
| Add | 
| 插入 | 
| 项 | 
| Remove | 
| RemoveAll | 
| Save | 
属性
| 名称 | 
|---|
| Application | 
| 类 | 
| Count | 
| Parent | 
| Session | 
另请参阅
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。