Share via


AutoFormatRule.Enabled プロパティ (Outlook)

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

関連項目

AutoFormatRule オブジェクト

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。