Add Method (UserProperties Collection)

Add Method (UserProperties Collection)

See Also         Example         Applies To

Creates a new user property in the UserProperties collection, and returns the new property as a UserProperty object.

Syntax

objUserProperties.Add(Name, Type, [AddToFolderFields], [DisplayFormat])

objUserProperties    Required. An expression that returns a UserProperties collection object.

Name   Required String. The name of the property.

Type   Required Long. The type of the property. Can be one of the following OlUserPropertyType constants: olCombination(19), olCurrency(14), olDateTime(5), olDuration(7), olFormula(18), olKeywords(11), olNumber(3), olPercent(12), olText(1), or olYesNo(6).

AddToFolderFields   Optional Boolean. True if the property will be added to the folder fields, False if not. The default value is True.

DisplayFormat   Optional Long. The index of the format of the specified OlUserPropertyType constant. For more information, see the "Remarks" section.

Remarks

To look up the index of a format to specify for the DisplayFormat argument, follow these steps.

  1. Open a new item in design mode.

  2. Click an empty page. If the Field Chooser is not displayed, click the Field Chooser button on the toolbar.

  3. In the Field Chooser, click the New button.

  4. In the New Field dialog box, select the appropriate field type in the Type box, and then find the format you want in the Format box. The index of the format corresponds to its position in this list. The first user property has an index of 1.