(Office) 的 PickerResults.Item 屬性
擷取位於指定索引處的 PickerResult 物件。 唯讀。
語法
expression.Item(Index)
表達 會傳回 PickerResults 物件的 運算式。
參數
名稱 | 必要/選用 | 資料類型 | 描述 |
---|---|---|---|
Index | 必要 | 整數 | 會指定整數,代表 PickerResult 物件的索引的位置。 |
範例
下列程式碼會顯示 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)
' 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
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。