RDOAddressEntry object represents a MAPI
address entry (IMailUser or IDistList Extended MAPI objects).
RDOAddressEntry.Manager
The example below logs to the default
MAPI session and displays the name of the currently logged-on user :
|
|
|
_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 |
GetProps(Tags) |
Retrieves multiple properties in a single call.
Tags - Variant array of integers or strings.
integer - assumed to be a property tag
string - assumed to be a DASL property name or a ";" separated
list of DASL property names
array - each element is either an integer (prop tag) or a
string (property name in the DASL format).
Returns a variant array of variants with the values of the requested
properties.
|
private
static
int[] _galDetailsPropTags =
new
int[]
{
(int)MAPITags.PR_DISPLAY_NAME_W,
(int)MAPITags.PR_GIVEN_NAME_W,
(int)MAPITags.PR_SURNAME_W,
(int)MAPITags.PR_TITLE_W,
(int)MAPITags.PR_COMPANY_NAME_W,
(int)MAPITags.PR_OFFICE_LOCATION_W,
(int)MAPITags.PR_DEPARTMENT_NAME_W,
(int)MAPITags.PR_MOBILE_TELEPHONE_NUMBER_W,
};
...
var props = galAddressEntry.GetProps(_galDetailsPropTags);
|
|
Properties |
|
Address |
String, read-write. E-mail
address. Corresponds to the PR_EMAIL_ADDRESS Extended MAPI property. |
|
AddressEntryUserType
|
rdoAddressEntryUserType enum, read-only. Represents the
type of the address entry.
olExchangeUserAddressEntry = 0
olExchangeDistributionListAddressEntry =1
olExchangePublicFolderAddressEntry = 2
olExchangeAgentAddressEntry = 3;
olExchangeOrganizationAddressEntry = 4
olExchangeRemoteUserAddressEntry = 5
olOutlookContactAddressEntry = 10
olOutlookDistributionListAddressEntry = 11
olLdapAddressEntry = 20
olSmtpAddressEntry = 30
olOtherAddressEntry = 40
|
|
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.
|
|
BusinessFaxNumber
|
String, read-write. Returns
the business fax number of the user.
Corresponds to the
PR_BUSINESS_FAX_NUMBER 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 |
HomePhone
|
String, read-write. Returns
the home telephone number of the user.
Corresponds to the
PR_HOME_TELEPHONE_NUMBER Extended MAPI property.
|
|
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
set Contact = recip.AddressEntry.GetContact
if not (Contact Is Nothing) Then
Debug.Print "Contact name: " &
Contact.FileAs
End If
set DL= recip.AddressEntry.GetDistList
if not (DL Is Nothing) Then
Debug.Print "DistList name: " & DL.DLName
End If
End 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.
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. |
|