/ Forums / Advansys Formativ / Creating Solutions with Formativ / Remote access of GroupWise Address Book / Reply To: Remote access of GroupWise Address Book
May 12, 2010 at 7:30 pm
#8178
Sorry for the delay.
Following code able to access ‘Office Phone Number’ in remote mode. This code used AddressBookEntries.Find() method to access the entry. Its a known behaviour that System Address Book supports a different set of filtering operations.
This code will match all entries with display name so if you have multiple entries with same display name then you could iterate entries where email address matches.
Sub Main(Client, GWEvent)
msgbox GetGWABField(GroupWise.Account.Owner, "Office Phone Number")
End Sub
Function GetGWABField(oAddress, strField)
Dim oField
dim oEntry
dim oEntries
dim objAddressBook
GetGWABField = ""
Set objAddressBook = Groupwise.Account.Addressbooks.Item("Novell GroupWise Address Book")
iFilter = "(Name MATCHES """ & oAddress.displayname & """)"
Set oEntries = objAddressBook.AddressBookEntries.Find(iFilter)
if (not oEntries is nothing) then
if (oEntries.count > 0) then
set oEntry = oEntries.item(1)
if (not oEntry is nothing) then
on error resume next
Set oField = oEntry.fields(strField, fgwString)
If err = 0 Then
GetGWABField = oField.Value
else
err.Clear
end if
end if
end if
end if
Set oField = Nothing
Set oEntry = Nothing
Set oEntries = Nothing
Set objAddressBook = Nothing
End Function
Hope this helps.
Regards,
Advansys Support