Export (0) Print
Expand All

AutoFormatRule.Standard Property (Outlook)

Published: July 16, 2012

Returns a Boolean value that indicates whether the AutoFormatRule object represents a built-in Outlook formatting rule. Read-only.

Version Added: Outlook 2007

expression .Standard

expression A variable that represents an AutoFormatRule object.

If the value of this property is set to True, then the Filter and Name properties of the AutoFormatRule object cannot be changed. Similarly, you cannot use the Remove method of the AutoFormatRules collection to delete a built-in Outlook formatting rule, nor can you use the Insert method of the AutoFormatRules collection to insert a custom formatting rule above or between the built-in Outlook formatting rules contained by that collection.

The following Visual Basic for Applications (VBA) example enumerates the AutoFormatRules collection for the current TableView object, disabling any custom formatting rule contained by the collection.

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 
 

Community Additions

ADD
Show:
© 2014 Microsoft