_UserDefinedProperties.Add Method
Creates a new UserDefinedProperty object and appends it to the collection.
Namespace: Microsoft.Office.Interop.Outlook
Assembly: Microsoft.Office.Interop.Outlook (in Microsoft.Office.Interop.Outlook.dll)
Syntax
'Declaration
<DispIdAttribute()> _
Function Add ( _
Name As String, _
Type As OlUserPropertyType, _
DisplayFormat As Object, _
Formula As Object _
) As UserDefinedProperty
'Usage
Dim instance As _UserDefinedProperties
Dim Name As String
Dim Type As OlUserPropertyType
Dim DisplayFormat As Object
Dim Formula As Object
Dim returnValue As UserDefinedProperty
returnValue = instance.Add(Name, Type, _
DisplayFormat, Formula)
[DispIdAttribute()]
UserDefinedProperty Add(
string Name,
OlUserPropertyType Type,
Object DisplayFormat,
Object Formula
)
Parameters
Name
Type: System.StringThe name of the new user-defined property.
Type
Type: Microsoft.Office.Interop.Outlook.OlUserPropertyTypeThe type of the new user-defined property.
DisplayFormat
Type: System.ObjectThe display format of the new user-defined property. This parameter can be set to a value from one of several different enumerations, determined by the OlUserPropertyType constant specified in the Type parameter. For more information on how Type and DisplayFormat interact, see DisplayFormat.
Formula
Type: System.ObjectThe formula used to calculate values for the new user-defined property. This parameter is ignored if the Type parameter is set to any value other than olCombination or olFormula.
Return Value
Type: Microsoft.Office.Interop.Outlook.UserDefinedProperty
A UserDefinedProperty object that represents the new user-defined property.
Remarks
You can create a property of a type that is defined by the OlUserPropertyType enumeration, except for the following types: olEnumeration, olOutlookInternal, and olSmartFrom.
See Also
Reference
_UserDefinedProperties Interface
_UserDefinedProperties Members
Microsoft.Office.Interop.Outlook Namespace
Other Resources
How to: Ensure that Custom Item Properties Are Supported in Folder-Level Queries