Skip Navigation Links
Home
+
About
+
Products
+
Support
+
Purchase
+
Search
+
Item (Property of LDAPAttributeCollection)
The Attribute at the given index.
Syntax
Item(Index As Variant) As LDAPAttribute
Remarks
Accepts two parameter types - numeric index and string. If the parameter is numeric, then the collection returns the attribute at that ordinal position in the collection. If the parameter is a string (including strings that represent numbers, such as "4"), then the collection will look up the attribute with the same name as the string that was passed. Because this property takes an untyped Variant parameter, it is advisable to explicitly coerce it to the desirable index type when calling this method. This will avoid simple type mismatch errors. This collection also supports the For...Each syntax.
Example
Set pLDAP = CreateObject("LDAPClient.3")
Call pLDAP.Connect("ldapserver")

' Find Barb's telephone number
Set pAttributeNames = CreateObject("LDAPClient.StringCollection")
Call pAttributeNames.Add("mail")
Set pEntries = pLDAP.Search("o=airius.com", "uid=bjensen")

' Get the "telephoneNumber" attribute
Set pAttribute = pEntries(0).Attributes.Item("telephoneNumber")
MsgBox pAttribute.Values(0).Value