RDOAccount object

 

RDOAccount object represents an Outlook account (mail, store or address book).

 

Other account objects are derived from the RDOAccount object and, in addition to the RDOAccount properties and methods, they implement properties and methods specific to the particular provider (such as RDOPOP3Account.POP3_Server property for the POP3/SMTP accounts).

It can be one of the following objects (all derived from the RDOAccount object). Check the RDOAccount.AccountType property.

RDOPOP3Account - POP3/SMTP accounts

RDOMAPIAccount - MAPI accounts

RDOIMAPAccount - IMAP4 accounts

RDOHTTPAccount - HTTP (Hotmail, MSDN, etc) accounts

RDOLDAPAccount - LDAP accounts

 

 

Returned by:

RDOAccounts.Item(Index)

RDOMail.Account

RDOStore.StoreAccount

 

The example below prints out POP3 server names for all POP3/SMTP accounts in the profile:

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Accounts = Session.Accounts
for each Account in Accounts
  if Account.AccountType = 0 Then 'atPOP3
    Debug.Print "POP3 server for account " & Account.Name & ": " & Account.POP3_Server
  end if
next

 

 


Derived from: IDispatch


Properties


AccountCategories

Integer, read-only. A combination of the rdoAccountCategory enums (acStore = 1, acMail = 2, acAddressBook = 4).

E.g. if the account provider implements both store and mail transport, the returned value will be 3 (acStore + acMail).

 

 

AccountType

rdoAccountType, read-only.

Can be one of the following values:

atPOP3 = 0
atIMAP = 1
atHTTP = 2
atExchange = 3
atMAPI = 4
atLDAP = 5
atOther = 6

 

See example above

AccountTypeStr

String, read-only. Returns the textual description of the account type, e.g. "MAPI", "LDAP", "POP/SMTP", etc.

 

 

Fields(PropTag)

Allows to read or set the account properties directly.

Returns or sets a variant of the type consistent with the property type (e.g. Variant string for the PT_UNICODE properties).

 

'print out account names using Account.Fields()

PROP_ACCT_NAME = &H0002001F
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Accounts = Session.Accounts
for each Account in Accounts
  Debug.Print Account.Fields(PROP_ACCT_NAME)
next

 

ID

Integer, read-only. Returns the account ID. Corresponds to the PROP_ACCT_ID property.

 

 

IsExchange

Boolean, read-only. Returns TRUE if the account is handled by the Exchange Server provider.. Corresponds to the PROP_ACCT_IS_EXCH property.

 

 

Name

String, read-only. Returns the account name. Corresponds to the PROP_ACCT_NAME property.

 

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Accounts = Session.Accounts
for each Account in Accounts
  Debug.Print Account.Name
next

 

SendStamp

String, read-only. Returns the account send stamp. Corresponds to the PROP_ACCT_SEND_STAMP property.

 

 

Session

Returns the parent RDOSession object. Read-only.

 

 

Stamp

String, read-only. Returns the account stamp. Corresponds to the PROP_ACCT_STAMP property.

 

 


Methods


Save

Saves the changes to the account.

 

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Accounts = Session.Accounts
for each Account in Accounts
  if Account.AccountType = 0 Then 'atPOP3
    Account.DaysBeforeDelete = 5
    Account.Save
  end if
next

 

Delete

Deletes the account from the profile.

 

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Account = Session.Accounts.Item("My ISP account")

Account.Delete

 

 

 

 

 

RDOPOP3Account object

 

RDOPOP3Account object represents an Outlook POP3/SMTP account.

 


Derived from: RDOAccount


Properties


DeleteFromServerAfterXDays

Boolean, read/write. Determines whether the messages are deleted from the POP3 server after the specified number of days. See DaysBeforeDelete property

 

 

DeleteFromServerWhenDeletedLocally

Boolean, read/write. If TRUE, the messages on the POP3 server are deleted when they are deleted from the local Deleted Items folder

 

 

DaysBeforeDelete

Number of days before the messages are deleted from the POP3 server. Only used if DeleteFromServerAfterXDays property is TRUE.

 

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Accounts = Session.Accounts
for each Account in Accounts
  if Account.AccountType = 0 Then 'atPOP3
    Account.DaysBeforeDelete = 5
    Account.Save
  end if
next

 

DeliverToFolder

RDOFolder, read/write. Specifies the folder where the messages retrieved from the given POP3/SMTP account will be delivered to.

 

This is property is Outlook 2007 specific; in the older versions, the default Inbox folder from the store specified by the DeliverToStore property will be used and the changes made to this property will be ignored by Outlook.

 

When set, the DeliverToStore  property (see below) will be adjusted appropriately.

 

 

DeliverToStore 

RDOStore, read/write. Specifies the store where the messages retrieved from the given POP3/SMTP account will be delivered to.

 

When the property is set, Inbox and Sent Items folders in the specified store will be created if they are not yet present.

 

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Account = Session.Accounts("test@dimastr.com")

set Store = Session.Stores.AddPstStore("c:\temp\NewStore", 1, "Store for test@dimastr.com")
Account.DeliverToStore = Session.Stores.DefaultStore
Account.Save

 

LeaveMessagesOnServer

Boolean, read/write. If TRUE, the messages are left on the POP3 sevrer.

 

Organization

String, read/write. The name of the organization.

 

 

POP3_Port

Integer, read/write. The TCP/IP port number used to communicate with the POP3 server. The default POP3 port is 110.

 

 

POP3_Server

String, read/write. The name of the POP3 server, e.g. mail.mydomain.com.

 

 

POP3_RememberPassword

Boolean, read/write. If TRUE, Outlook will remember the POP3 password. If FALSE, the user will be prompted for credentials every time the password is required.

 

 

POP3_UserName

String, read/write. The user name used to log on to the POP3 server.

 

 

POP3_UseSPA

Boolean, read/write. Determines whether Secure Password Authentication (SPA) is used when authenticating with the POP3 server.

 

 

POP3_UseSSL

Boolean, read/write. Determines whether Secure Socket Layer (SSL) is used to communicate with the POP3 server.

 

 

ReplyAddress

String, read/write. The address to which e-mail replies will be sent by the recipients of the messages sent through this POP3/SMTP account.

 

 

SaveSentMessageFolder

RDOFolder, read-only. Specifies the folder where the messages sent using the given POP3/SMTP account will be saved.

 

 

SMTPAddress

String, read/write. The SMTP address of the user.

 

 

SMTP_EncryptionType
Specifies the encryption used when sending through the SMTP server, read/write.

cetNone = 0
cetSSL = 1
cetTLS =2
cetAuto = 3
 

SMTP_LogonKind

rdoSMTPLogonKind, read/write. One of the following values can be used:

lkSameAsIncoming = 0,
lkUseSMTPCredentials = 1,
lkLogToIncomingFirst = 2

 

 

SMTP_Port

Integer, read/write. The TCP/IP port number used to communicate with the SMTP server. The default SMTP port is 25.

 

 

SMTP_Server

String, read/write. The name of the SMTP server, e.g. mail.mydomain.com.

 

 

SMTP_UseAuth

Boolean, read/write. Determines whether authentication is required when communicating with the SMTP server. See SMTP_LogonKind property.

 

 

SMTP_UserName

String, read/write. The user name used to log on to the POP3 server.

See the SMTP_UseAuth and SMTP_LogonKind properties.

 

 

SMTP_UseSPA

Boolean, read/write. Determines whether Secure Password Authentication (SPA) is used when authenticating with the SMTP server

 

 

SMTP_UseSSL

Boolean, read/write. Determines whether Secure Socket Layer (SSL) is used to communicate with the SMTP server.

 

 

TimeOut

Integer, read/write. Timeout (in sec) used when communicating with the POP3 and SMTP servers.

 

 

UserName

String, read/write. The display of the user to be used when sending messages though SMTP (e.g. "Joe The User").

 

 


 

 

 

RDOMAPIAccount object

 

RDOMAPIAccount object represents an Outlook MAPI account (such a PST store).

 


Derived from: RDOAccount


Properties


     

ServiceName

String, read-only. The MAPI service name of the account, e.g. "CONTAB" or "MSPST MS".

 

 

ServiceUID

String, read-only. Returns a hex string representing PR_SERVICE_UID property of the MAPI service from the IMsgServiceAdmin::GetMsgServiceTable table.

 

 

 

 

RDOIMAPAccount object

 

RDOIMAPAccount object represents an Outlook IMAP4/SMTP account.

 


Derived from: RDOAccount


Properties


Organization

String, read/write. The name of the organization.

 

 

IMAP_EncryptionType
Specifies the encryption used when connecting to the IMAP4 server, read/write.

cetNone = 0
cetSSL = 1
cetTLS =2
cetAuto = 3
 

IMAP_Port

Integer, read/write. The TCP/IP port number used to communicate with the IMAP4 server. The default IMAP4 port is 143.

 

 

IMAP_Server

String, read/write. The name of the IMAP4 server, e.g. mail.mydomain.com.

 

 

IMAP_RememberPassword

Boolean, read/write. If TRUE, Outlook will remember the IMAP4 password. If FALSE, the user will be prompted for credentials every time the password is required.

 

 

IMAP_RootPath

String, read/write. The root path to the mailbox on the IMAP4 server.

 

 

IMAP_UserName

String, read/write. The user name used to log on to the IMAP4 server.

 

 

IMAP_UseSPA

Boolean, read/write. Determines whether Secure Password Authentication (SPA) is used when authenticating with the IMAP4 server.

 

 

IMAP_UseSSL

Boolean, read/write. Determines whether Secure Socket Layer (SSL) is used to communicate with the IMAP4 server.

 

 

ReplyAddress

String, read/write. The address to which e-mail replies will be sent by the recipients of the messages sent through this IMAP4/SMTP account.

 

 

SaveSentMessageFolder

RDOFolder, read-only. Specifies the folder where the messages sent using the given POP3/SMTP account will be saved.

 

set Session = CreateObject("Redemption.RDOSession")
Session.Logon
set Account = Session.Accounts("dmitry@dimastr.com")
if Account.AccountType = 1 Then 'atIMAP
    MsgBox Account.SaveSentMessageFolder.Name
End If

 

SMTPAddress

String, read/write. The SMTP address of the user.

 

 

SMTP_EncryptionType
Specifies the encryption used when sending through the SMTP server, read/write.

cetNone = 0
cetSSL = 1
cetTLS =2
cetAuto = 3
 

SMTP_LogonKind

rdoSMTPLogonKind, read/write. One of the following values can be used:

lkSameAsIncoming = 0,
lkUseSMTPCredentials = 1,
lkLogToIncomingFirst = 2

 

 

SMTP_Port

Integer, read/write. The TCP/IP port number used to communicate with the SMTP server. The default SMTP port is 25.

 

 

SMTP_Server

String, read/write. The name of the SMTP server, e.g. mail.mydomain.com.

 

 

SMTP_UseAuth

Boolean, read/write. Determines whether authentication is required when communicating with the SMTP server. See SMTP_LogonKind property.

 

 

SMTP_UserName

String, read/write. The user name used to log on to the POP3 server.

See the SMTP_UseAuth and SMTP_LogonKind properties.

 

 

SMTP_UseSPA

Boolean, read/write. Determines whether Secure Password Authentication (SPA) is used when authenticating with the SMTP server

 

 

SMTP_UseSSL

Boolean, read/write. Determines whether Secure Socket Layer (SSL) is used to communicate with the SMTP server.

 

 

Store

RDOStore, read-only. Returns the store used by the IMAP account.

 

 

TimeOut

Integer, read/write. Timeout (in sec) used when communicating with the POP3 and SMTP servers.

 

 

UserName

String, read/write. The display of the user to be used when sending messages though SMTP (e.g. "Joe The User").

 

 

 

 

 

RDOHTTPAccount object

 

RDOHTTPAccount object represents an Outlook HTTP account (such as Hotmail or MSN).

 


Derived from: RDOAccount


Properties


LoginName

String, read/write. The login name

 

 

Organization

String, read/write. The name of the organization.

 

 

RememberPassword

Boolean, read/write. If TRUE, Outlook will remember the password. If FALSE, the user will be prompted for credentials every time the password is required.

 

 

ReplyAddress

String, read/write. The address to which e-mail replies will be sent by the recipients of the messages sent through this HTTP account.

 

 

Server

String, read/write. The name of the HTTP server, e.g. mail.mydomain.com.

 

 

SMTPAddress

String, read/write. The SMTP address of the user.

 

 

Store

RDOStore, read-only. Returns the store used by the HTTP account.

 

 

UserName

String, read/write. The display of the user to be used when sending messages though SMTP (e.g. "Joe The User").

 

 

UseSPA

Boolean, read/write. Determines whether Secure Password Authentication (SPA) is used when authenticating with the HTTP server.

 

 

 

 

 

RDOLDAPAccount object

 

RDOLDAPAccount object represents an Outlook LDAP address book account.

 


Derived from: RDOMAPIAccount


Properties


MaxResults

Integer, read/write. The maximum number of results to return.

 

 

Port

Integer, read/write. The TCP/IP port used to communicate with the LDAP server.

 

 

SearchBase

String, read/write. The LDAP search base, e.g. "cn=users"

 

 

SearchTemplate

String, read/write. The search string to be used in the search queries, e.g. "(&(mail=*)(|(mail=%s*)(|(cn=%s*)(|(sn=%s*)(givenName=%s*)))))"

 

 

SearchTimeout

Integer, read/write. Timeout (in sec) used when communicating with the LDAP server.

 

 

ServerName

String, read/write. The name of the LDAP server, e.g. ldap.mydomain.com.

 

 

UserName

String, read/write. The user name used to log in to the LDAP server.

 

 

UseSPA

Boolean, read/write. Determines whether Secure Password Authentication (SPA) is used when authenticating with the LDAP server.

 

 

UseSSL

Boolean, read/write. Determines whether Secure Socket Layer (SSL) is used to communicate with the LDAP server.