AutoFormatRule。Outlook) (Standard属性

返回一个 布尔 值,该值指示 AutoFormatRule 对象是否表示一个内置的 Outlook 格式设置规则。 此为只读属性。

语法

expression。 Standard

表达式 表示 AutoFormatRule 对象的变量。

备注

如果此属性的值设置为 True,则 AutoFormatRule 对象的 Filter 和 Name 属性不能更改。 同样,不能使用 AutoFormatRules 集合的 Remove 方法删除内置的 Outlook 格式规则,也不能使用 AutoFormatRules 集合的 Insert 方法在该集合包含的内置 Outlook 格式规则上方或之间插入自定义格式规则。

示例

下面的 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

另请参阅

AutoFormatRule 对象

支持和反馈

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