PickerResults.Item property (Office)
Retrieves a PickerResult object at the specified index. Read-only.
Syntax
expression.Item(Index)
expression An expression that returns a PickerResults object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
Index | Required | Integer | Specifies an integer representing the indexed location of the PickerResult object. |
Example
The following code displays the PickerDialog user interface, gets results, and then enumerates those results.
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)
' Enumerate the results.
For index = 1 To objPickerResults.Count-1
Debug.Print objPickerResults.Item(index).Id
Debug.Print objPickerResults.Item(index).DisplayName
Debug.Print objPickerResults.Item(index).Type
Debug.Print objPickerResults.Item(index).SIPId
Next
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.
Geri Bildirim
https://aka.ms/ContentUserFeedback.
Çok yakında: 2024 boyunca, içerik için geri bildirim mekanizması olarak GitHub Sorunları’nı kullanımdan kaldıracak ve yeni bir geri bildirim sistemiyle değiştireceğiz. Daha fazla bilgi için bkz.Gönderin ve geri bildirimi görüntüleyin