UserDefinedProperty オブジェクト (Outlook)

Folder オブジェクトのユーザー定義プロパティの定義を表します。

注釈

1 つの UserDefinedProperty オブジェクトを返すには、UserDefinedProperties (index) を使用します。index は名前またはインデックス番号です。

Folder オブジェクトの UserDefinedProperties コレクションの Add メソッドを使用して、そのフォルダーのユーザー定義プロパティを定義します。

ユーザー定義プロパティの表示形式を取得するのにには、ユーザー定義プロパティの型、 DisplayFormat プロパティを取得するのにには、 Type プロパティを使用します。 OlCombination または olFormulaType プロパティを設定すると、 Formula プロパティを使用して、ユーザー定義プロパティの値を生成するために使用する数式を返します。

UserDefinedProperty オブジェクトは、フォルダーに格納されているすべての Outlook アイテムに適用できるユーザー定義のプロパティの定義のみを表します。 取得または、そのフォルダー内の Outlook アイテムのユーザー定義のプロパティ値を変更、そのアイテムの [ユーザー プロパティ] コレクションを取得するのには、 MailItem オブジェクトなどの Outlook アイテムの [ユーザー プロパティ] プロパティを使用します。 取得または Outlook アイテムのユーザー定義プロパティの値を変更し、適切なユーザー定義プロパティの UserProperty オブジェクトを使用できます。

次の Visual Basic for Applications (VBA) の例は、指定された Folder オブジェクトの名前、および指定された Folder オブジェクトの UserDefinedProperties コレクションに含まれているすべての UserDefinedProperty オブジェクトの名前と種類を、イミディエイト ウィンドウに表示します。

Sub DisplayUserProperties(ByRef FolderToCheck As Folder) 
 Dim objProperty As UserDefinedProperty 
 
 ' Print the name of the specified Folder object 
 ' reference to the Immediate window. 
 Debug.Print "--- Folder: " & FolderToCheck.Name 
 
 ' Check if there are any user-defined properties 
 ' associated with the Folder object reference. 
 If FolderToCheck.UserDefinedProperties.Count = 0 Then 
 ' No user-defined properties are present. 
 Debug.Print " No user-defined properties." 
 Else 
 ' Iterate through every user-defined property in 
 ' the folder. 
 For Each objProperty In FolderToCheck.UserDefinedProperties 
 ' Retrieve the name of the user-defined property. 
 strPropertyInfo = objProperty.Name 
 ' Retrieve the type of the user-defined property. 
 Select Case objProperty.Type 
 Case OlUserPropertyType.olCombination 
 strPropertyInfo = strPropertyInfo & " (Combination)" 
 Case OlUserPropertyType.olCurrency 
 strPropertyInfo = strPropertyInfo & " (Currency)" 
 Case OlUserPropertyType.olDateTime 
 strPropertyInfo = strPropertyInfo & " (Date/Time)" 
 Case OlUserPropertyType.olDuration 
 strPropertyInfo = strPropertyInfo & " (Duration)" 
 Case OlUserPropertyType.olEnumeration 
 strPropertyInfo = strPropertyInfo & " (Enumeration)" 
 Case OlUserPropertyType.olFormula 
 strPropertyInfo = strPropertyInfo & " (Formula)" 
 Case OlUserPropertyType.olInteger 
 strPropertyInfo = strPropertyInfo & " (Integer)" 
 Case OlUserPropertyType.olKeywords 
 strPropertyInfo = strPropertyInfo & " (Keywords)" 
 Case OlUserPropertyType.olNumber 
 strPropertyInfo = strPropertyInfo & " (Number)" 
 Case OlUserPropertyType.olOutlookInternal 
 strPropertyInfo = strPropertyInfo & " (Outlook Internal)" 
 Case OlUserPropertyType.olPercent 
 strPropertyInfo = strPropertyInfo & " (Percent)" 
 Case OlUserPropertyType.olSmartFrom 
 strPropertyInfo = strPropertyInfo & " (Smart From)" 
 Case OlUserPropertyType.olText 
 strPropertyInfo = strPropertyInfo & " (Text)" 
 Case OlUserPropertyType.olYesNo 
 strPropertyInfo = strPropertyInfo & " (Yes/No)" 
 Case Else 
 strPropertyInfo = strPropertyInfo & " (Unknown)" 
 End Select 
 
 ' Print the name and type of the user-defined property 
 ' to the Immediate window. 
 Debug.Print strPropertyInfo 
 Next 
 End If 
End Sub 

メソッド

名前
Delete

プロパティ

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

関連項目

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

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

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