RDOAddressEntry object

 

RDOAddressEntry object represents a MAPI address entry (IMailUser or IDistList Extended MAPI objects).

 

Returned by:

RDOSession.CurrentUser, GetAddressEntryFromID

RDOExchangeMailboxStore.Owner

RDOAddressBook.GetAddressEntryFromID, ResolveName

RDOAddressList.ResolveName

RDOAddressEntries.GetFirst, GetLast, GetNext, GetPrevious, Item

RDOAddressEntry.Manager

RDORecipient.AddressEntry

RDOMail.Sender, SentOnBehalfOf

 

The example below logs to the default MAPI session and displays the name of the currently logged-on user :

set Session = CreateObject("Redemption.RDOSession")
Session.Logon
set User = Session.CurrentUser
MsgBox User.Name

 

The example below (Exchange specific) resolves a name to an RDOAddressEntry object and prints out the users who can send of behalf of the given user:

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT  'reuse MAPI session from Outlook
set AddressEntry = Session.AddressBook.GAL.ResolveName("dmitry")
Debug.Print "-- Delegates (who can send of behalf of " & AddressEntry.Name & ")"
for each AE in AddressEntry.Delegates
    Debug.Print AE.Name
next
Debug.Print "-- Is delegate for (can send on behalf of these users)"
for each AE in AddressEntry.IsDelegateFor
    Debug.Print AE.Name
next
Debug.Print "-- Is member of the following Dist Lists:"
for each AE in AddressEntry.IsMemberOfDL
    Debug.Print AE.Name
next
Debug.Print "-- The following users report to " & AddressEntry.Name
    for each AE in AddressEntry.Reports
Debug.Print AE.Name
next

 


Derived from: _MAPIProp -


_MAPIProp methods and properties: GetIDsFromNames, Fields(), GetPropList, GetNamesFromIDs, CopyTo, Save, MAPIOBJECT, Session

 

CopyTo(DestObj)

Copies the address entry to the destination object. RDOAdressEntry overrides the behavior inherited from _MAPIProp depending on the type of the DestObj parameter, which can be either a message represented by the RDOMail object (or any of its descendants, such as RDOContactItem) or a folder represented by the RDOFolder object.

 

In case case of RDOMail, the method will export either the data either as an RDOContactItem object or an RDODistListItem, depending on whether the address entry represents a mail user or a distribution list. The item passed as a parameter is not saved.

 

If the parameter is an RDOFolder object, the new item will be created and saved in the target folder.

 

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Folder = Session.getDefaultFolder(olFolderContacts)
set AB = Session.AddressBook
set Recips = AB.ShowAddressBook
for each Recip in Recips
  set AE = Recip.AddressEntry
  if Not AE Is Nothing Then
    AE.CopyTo(Folder)
  End If
next


Properties


Address

String, read-write. E-mail address.

Corresponds to the PR_EMAIL_ADDRESS Extended MAPI property.

 

 

Alias

String, read-only. Returns the Windows account alias of the corresponding AD user.

Corresponds to the PR_ACCOUNT Extended MAPI property.

 

 

AssistantName

String, read-write. Returns the name of the assistant.

Corresponds to the PR_ASSISTANT Extended MAPI property.

 

 

BusinessTelephoneNumber

String, read-write. Returns the business telephone number of the user.

Corresponds to the PR_OFFICE_TELEPHONE_NUMBER Extended MAPI property.

 

 

City

String, read-write. Returns the city for the user.

Corresponds to the PR_LOCALITY Extended MAPI property.

 

 

Comments

String, read-write. Returns the comments  for the user.

Corresponds to the PR_COMMENT Extended MAPI property.

 

 

CompanyName

String, read-write. Returns the name of the company for the user.

Corresponds to the PR_COMPANY_NAME Extended MAPI property.

 

 

Country

String, read-write. Returns the name of the country for the user.

Corresponds to the PR_BUSINESS_ADDRESS_COUNTRY Extended MAPI property.

 

 

Delegates

Returns RDOAddressEntries object representing the collection of RDOAddressEntry objects who can send on behalf of the given address entry object.

Exchange only. Returns NULL for other address book providers.

Corresponds to the PR_EMS_AB_PUBLIC_DELEGATES Extended MAPI property.

 

 

Department

String, read-write. Returns the name of the department for the user.

Corresponds to the PR_DEPARTMENT Extended MAPI property.

 

 

DisplayType

Integer, read-only. Corresponds to the PR_DISPLAY_TYPE Extended MAPI property.

 

 

EntryID

String, read-only. Entry ID of the address entry.

Corresponds to the PR_ENTRYID Extended MAPI property.

 

 

FirstName

String, read-write. Returns the first name of the user.

Corresponds to the PR_GIVEN_NAME Extended MAPI property.

 

 

FreeBusyList

Returns a collection (RDOFreeBusyRange) of all published free/busy slots available for the Exchange user.

 

For address types other than Exchange, NULL is returned.

set Session = CreateObject("Redemption.RDOSession")
Session.Logon
set Recips = Session.AddressBook.ShowAddressBook( , "Please select an Exchange User", true, true)
if Recips.Count > 0 Then
  set User = Recips(1).AddressEntry
  if User.Type = "EX" Then
  set Events = User.FreeBusyList
  for each slot in Events
    Debug.Print slot.Start & " - " & slot.End & " - " & slot.BusyStatus
  next
  End If
End If

 

IsMemberOfDL

Returns RDOAddressEntries object representing the collection of Distribution Lists (RDOAddressEntry object) of which the given Address Entry is a member.

Exchange only. Returns NULL for other address book providers.

Corresponds to the PR_EMS_AB_IS_MEMBER_OF_DL Extended MAPI property.

 

 

IsDelegateFor

Returns RDOAddressEntries object representing the collection of RDOAddressEntry objects on whose behalf the given address entry object can send messages.

Exchange only. Returns NULL for other address book providers.

Corresponds to the PR_EMS_AB_PUBLIC_DELEGATES_BL_O Extended MAPI property.

 

 

JobTitle

String, read-write. Returns the job title of the user.

Corresponds to the PR_TITLE Extended MAPI property.

 

 

LastName

String, read-write. Returns the last name of the user.

Corresponds to the PR_SURNAME Extended MAPI property.

 

 

Manager

RDOAddressEntry, read-only. Returns the object representing the manager of the given mail user (Exchange only).

Corresponds to the PR_EMS_AB_MANAGER Extended MAPI property.

 

 

Members

Returns RDOAddressEntries object representing the members of the distribution list. Returns NULL if the given RDOAddressEntry object is not a distribution list.

 

 

MobileTelephoneNumber

String, read-write. Returns the mobile telephone number of the user.

Corresponds to the PR_CELLULAR_TELEPHONE_NUMBER Extended MAPI property.

 

 

Name

String, read-write. The name of the address entry

Corresponds to the PR_DISPLAY_NAME Extended MAPI property.

 

see example above

NTAccountName

String, read-only. Returns the domain user account name in the form domain\user.

Corresponds to the PR_EMS_AB_ASSOC_NT_ACCOUNT Extended MAPI property converted to the domain/name format using LookupAccountSid Windows API function.

Exchange only

 

 

NTAccountSid

String, read-only. Returns the domain user account as a SID.

Corresponds to the PR_EMS_AB_ASSOC_NT_ACCOUNT Extended MAPI property converted to a string SID using ConvertSidToStringSid Windows API function.

Exchange only

 

 

OfficeLocation

String, read-write. Returns the office location for the user.

Corresponds to the PR_OFFICE_LOCATION Extended MAPI property.

 

 

Owners
Returns an RDOAddressEntries collection object that contains all the owners of the Exchange Distribution List. Returns null for the objects that do not expose the PR_EMS_AB_OWNER_O property.

 

PostalCode

String, read-write. Returns the office location for the user.

Corresponds to the PR_OFFICE_LOCATION Extended MAPI property.

 

 

Reports

Returns RDOAddressEntries object representing the collection of RDOAddressEntry objects who directly report to the given address entry; i.e. their Manager property points to the given address entry object.

Exchange only. Returns NULL for other address book providers.

Corresponds to the PR_EMS_AB_REPORTS Extended MAPI property.

 

 

SMTPAddress

String, read-only. Returns the SMTP address of the given user. If the address type is "SMTP", the returned value is the same as that returned by the Address property. If the address type is "EX", Redemption tries to retrieve the PR_SMTP_ADDRESS property, if unsuccessful, it retrieves the default SMTP address from the PR_EMS_AB_PROXY_ADDRESSES Extended MAPI property.

 

StateOrProvince

String, read-write. Returns the state or province for the user.

Corresponds to the PR_STATE_OR_PROVINCE Extended MAPI property.

 

 

StreetAddress

String, read-write. Returns the street address for the user.

Corresponds to the PR_STREET_ADDRESS Extended MAPI property.

 

 

Type

String, read-only. The type of the address, e.g. "SMTP", "EX", etc.

Corresponds to the PR_ADDRTYPE Extended MAPI property.

 

 


Methods


Delete

Deletes the address entry

 

 

Details(HWnd)

Displays a modal dialog box that provides detailed information about RDOAddressEntry object.

HWnd - integer, optional. The parent window handle for the Details dialog box. If the parameter is not specified or is zero, the method uses the foreground window as the dialog's parent.

 

 

GetAutodiscoverXml(UserName, Password)
Returns the autodiscover XML from the Exchange server that hosts the specified address entry.
SMTPAddress property needs to be able to return a valid SMTP address for this method to work properly.
The user name and password can either be specified explicitly (see below), or GetAutodiscoverXml will use the identity of the current Windows user or the credentials cached using the RDOCredentials object.

UserName - string, optional.
Password - string, optional.
 
set Session = CreateObject("Redemption.RDOSession")
userEntryId = Session.CreateOneOffEntryID("Test User", "SMTP", "test@MySite.onmicrosoft.com", false, true)
set AddressEntry = Session.AddressBook.GetAddressEntryFromId(userEntryId)
MsgBox AddressEntry.GetAutodiscoverXml("test@MySite.onmicrosoft.com", "MyPassword")

GetContact

Returns an IRDOContactItem object if the given address entry is provided by the Outlook Address Book (OAB) provider. For all other address entries, or if the underlying object is not a contact, NULL is returned.

 

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set item = Session.GetMessageFromID(Application.ActiveExplorer.Selection(1).EntryID)
for each recip in item.Recipients
  set AE = recip.AddressEntry
   if not (AE Is Nothing) Then
     s
et Contact = recip.AddressEntry.GetContact
 
   if not (Contact Is Nothing) Then
        Debug.Print "Contact name: " & Contact.FileAs
     End If
     s
et DL= recip.AddressEntry.GetDistList
     i
f not (DL Is Nothing) Then
       Debug.Print "DistList name: " & DL.DLName
     E
nd If
   E
nd if
next

GetDistList Returns an RDODistListItem object if the given address entry is provided by the Outlook Address Book (OAB) provider. For all other address entries, or if the underlying object is not a distribution list, NULL is returned.

see example above

GetFreeBusy(Start, MinPerChar, CompleteFormat)

Returns a string representing the availability of the individual user for a period of 30 days from the start date, beginning at midnight of the date specified.

Start- Required Date. Specifies the date.

MinPerChar - Required integer. Specifies the length of each time slot in minutes. Default is 30 minutes.

CompleteFormat - Optional Variant

 

As of version 5.2, this method uses the Exchange Web Services API to retrieve the free/busy data (Exchange 2007 or higher). If the autodiscover information cannot be retrieved for the given address, the method falls back to the old (Exchange 2003 and below) Public Folders based free/busy information. If the current user does not have the right to access the autodiscover or free/busy information on the Exchange server, the credentials for this method can specified by calling RDOSession.Credentials.Add method

 

set Session = CreateObject("Redemption.RDOSession")
Session.Logon
set AE = Session.AddressBook.ResolveName("dmitry streblechenko")
MsgBox AE.GetFreeBusy(Now, 30, true)

 

GetMailTips(CredentialsUserName, CredentialsPassword) Returns RDOMailTips object representing the mail tips for the Exchange user represented by the RDOAddressEntry object.

CredentialsUserName - string. optional. If specified, the user name to be used in the EWS call performed by Redemption. If not specified, the current user credentials are used (on-premises Exchange server only).
This not the SMTP address of the user for whom the mail tips are to be retreived.

CredentialsPassword - string. optional. If specified, the password to be used in the EWS call performed by Redemption.

set Session = CreateObject("Redemption.RDOSession")

Session.MAPIOBJECT = Application.Session.MAPIOBJECT

Session.SkipAutodiscoverLookupInAD = true

set AdrEntry = Session.AddressBook.ResolveName("user@domain.demo")

set mailTips = AdrEntry.GetMailTips("me@domain.demo", "<My Password>") 'optional authentication parameters for EWS

MsgBox mailTips.MaxMessageSize   

GetOutOfOfficeAssistant (CredentialsUserName, CredentialsPassword) Returns RDOOutOfOfficeAssistant object representing the OOF settings for the Exchange user represented by the RDOAddressEntry object.
Warning: this method requires impersonation privileges.

CredentialsUserName - string. optional. If specified, the user name to be used in the EWS call performed by Redemption. If not specified, the current user credentials are used (on-premises Exchange server only).
This not the SMTP address of the user for whom the mail tips are to be retreived.

CredentialsPassword - string. optional. If specified, the password to be used in the EWS call performed by Redemption.

set Session = CreateObject("Redemption.RDOSession")

Session.MAPIOBJECT = Application.Session.MAPIOBJECT

Session.SkipAutodiscoverLookupInAD = true

set AdrrEntry = Session.AddressBook.ResolveName("user@domain.demo")

set oofSettings = AdrrEntry.GetOutOfOfficeAssistant("me@domain.demo", "<My Password>") 'optional authentication parameters for EWS

MsgBox oofSettings.StartTime     

GetPicture Returns an instance of the IPicture COM object.
For the GAL entries, the data is retrieved from the PR_EMS_AB_THUMBNAIL_PHOTO MAPI property, for the Contacts - from the image attachment. Otherwise Redemption attempts to use the LinkedIn Social provider to download the picture.
 

UpdateFreeBusy

Updates the free-busy info for the given user.