PickerResults.Add method (Office)

Adds a PickerResult object to the PickerResults collection.

Syntax

expression.Add (Id, DisplayName, Type, SIPId, ItemData, SubItems)

expression An expression that returns a PickerResults object.

Parameters

Name Required/Optional Data type Description
Id Required String Represents an identifier of the PickerResult.
DisplayName Required String Represents a display name of the PickerResult.
Type Required String Represents a type of the PickerResult.
SIPId Optional String Currently not supported. The SIPId is the identifier for Office Communication Server. It's used only for the people picking scenario.
ItemData Optional Variant Non-displaying item binding data.
SubItems Optional Variant Displays the purpose or non-display purpose field data of the PickerResult. It's used for passing column values in the PickerDialog.

Return value

PickerResult

Example

The following code sets the PickerDialog properties and then displays the PickerDialog.

Dim objPickerDialog As PickerDialog 
Dim objPickerProperties As PickerProperties 
Dim objPickerProperty As PickerProperty 
Dim objPickerExistingResults As PickerResults 
Dim objPickerExistingResults As PickerResult 
Dim objPickerResults As PickerResults 
 
' Configure the Picker Dialog properties. 
Set objPickerDialog = Application.PickerDialog 
objPickerDialog.DataHandlerId = "{000CDF0A-0000-0000-C000-000000000046}" 
objPickerDialog.Title = "Sample Picker Dialog" 
Set objPickerProperties = objPickerDialog.Properties 
Set objPickerProperty = objPickerProperties.Add("SiteUrl", "https://my", msoPickerFieldtypeText) 
Set objPickerExistingResults = objPickerDialog.CreatePickerResults 
Set objPickerExistingResult = objPickerExistingResults.Add("johndoe@contoso.com", "John Doe", "User") 
 
' Show the Picker Dialog and get the results. 
Set objPickerResults = objPickerDialog.Show(True, objPickerExistingResult)

See also

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.