AutoFormatRules オブジェクト (Outlook)

ビュー内の AutoFormatRule オブジェクトのコレクションを表します。

注釈

View オブジェクトから派生した次のオブジェクトの新しい書式設定ルールを作成するのには、 Add メソッドまたは AutoFormatRules コレクションの Insert メソッドを使用します。

AutoFormatRules コレクションに含まれる AutoFormatRule オブジェクトは、コレクションに格納されている順序に従って、各 Outlook アイテムに適用されます。 AutoFormatRule オブジェクトに対する変更は、AutoFormatRules コレクションの Save メソッドが呼び出された場合にのみ保存されます。

次の 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 
 

メソッド

名前
Add
Insert
アイテム
Remove
RemoveAll
Save

プロパティ

名前
アプリケーション
クラス
Count
Parent
Session

関連項目

Outlook オブジェクト モデル リファレンス

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

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