Share via


AutoFormatRule.Standard Property

Outlook Developer Reference

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

Version Information
 Version Added:  Outlook 2007

Syntax

expression.Standard

expression   A variable that represents an AutoFormatRule object.

Remarks

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.

Example

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.

Visual Basic for Applications
  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

See Also