會傳回或設定 Boolean 值,指出是否要啟用 AutoFormatRule 物件所代表的格式化規則。 讀取/寫入。
語法
表情。啟用
詞 一個代表 AutoFormatRule 物件的變數。
範例
以下 Visual Basic for Applications (VBA) 範例列舉了目前 TableView 物件的 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
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。