RDOOutOfOfficeAssistant object

 

RDOOutOfOfficeAssistant represents a special Exchange rule, which ,when turned on, replies to each incoming message with a predefined message.

Note that RDO (unlike CDO 1.21) exposes OOF on the store level, not session. This means that you can manipulate OOF properties of a store other than the default one.

 

As of version 5.3, Redemption uses Exchange Web Services (EWS) API to manipulate the OOF rules. If EWS is not available (Exchange 2003 or below), Redemption falls back to MAPI.

Only OutOfOfficeText, OutOfOffice and  OutOfOfficeMessage are MAPI specific and supported in all versions of Exchange. All other properties are EWS specific and will raise an error when used under Exchange 2003 or older.

EWS (unlike MAPI) allows to specify separate external/internals replies, specify the OOF time range, etc.

Note that if the current process is not running under the identity of a domain user who can access the particular mailbox, Redemption will need the credentials of a domain user who can (see Session.Credentials.Add in the second example below).

To avoid having to update the Exchange server too frequently, call BeginUpdate before updating multiple properties, and call EndUpdate after you are done. Otherwise Redemption will update the Exchange server after each property is modified.

 

Returned by:

RDOExchangeMailboxStore.OutOfOfficeAssistant

RDOAddressEntry.GetOutOfOfficeAssistant

 

The example below sets the default store as being OOF.

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Store = Session.Stores.DefaultStore
if (Store.StoreKind = skPrimaryExchangeMailbox) or (Store.StoreKind = skDelegateExchangeMailbox) Then
  set OOFAssistant = Store.OutOfOfficeAssistant
  OOFAssistant.OutOfOffice = true
  OOFAssistant.OutOfOfficeText = "Sorry, I am out of office at the moment!"
Else
  MsgBox "Out Of Office Assistant is only available for the Exchange mailboxes"
End If


The example below sets separate internal/external OOF replies and specifies the OOF time range.

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
Session.Credentials.Add "*.myserver.com", "Domain\UserName", "MyPassword"
set OofAssistant = Session.Stores.DefaultStore.OutOfOfficeAssistant
OofAssistant.BeginUpdate
OofAssistant.StartTime = #12/21/2011#
OofAssistant.EndTime = #01/03/2012 9:00#
OofAssistant.State = 2 'rdoOofScheduled
OofAssistant.ExternalAudience = 1 'rdoOofAudienceKnown
OofAssistant.OutOfOfficeTextInternal = "<html><body>I am on vacation from 12/21/2001 until 01/03/2012. Please contact " & _

                                                                     "<a href=""mailto:Joe.User@MyCompany.com"">Joe User</a>" & _

                                                                     " if you have any questions</body></html>"
OofAssistant.OutOfOfficeTextExternal = "<html><body>I am on <b>vacation</b> until next year. </body></html>"
OofAssistant.EndUpdate



Derived from: IDispatch


Properties


EndTime
Specifies the end time of the time range when OOF replies are active.
Date/Time, read/write.
Setting this property sets the State property to rdoOofScheduled.
 
 
ExternalAudience
One of the rdoOofExternalAudience enums, read/write.
Specifies whether the OOF replies will be sent to senders (rdoOofAudienceAll), only to the known senders (rdoOofAudienceKnown), or to no senders at all (rdoOofAudienceNone).
 
rdoOofAudienceNone = 0
rdoOofAudienceKnown = 1
rdoOofAudienceAll = 2
 
 
OutOfOfficeText
String, read/write. Returns or sets the text used in the OOF reply message.
This property returns or sets the plain text version of the OOF text only. It is set using MAPI only, not EWS.
 
 
OutOfOfficeTextExternal HTML text of the OOF reply to be sent to the external senders.
String, read/write.
 
 
OutOfOfficeTextInternal
HTML text of the OOF reply to be sent to the internal senders.
String, read/write.
 
 
OutOfOffice
Boolean, read/write. Returns or sets the OOF state.
 
 
OutOfOfficeMessage Returns RDOMail object used as template for the OOF message. E.g. OutOfOfficeText property is stored as a body of this message.
 
 
StartTime
Specifies the start time of the time range when OOF replies are active.
Date/Time, read/write.
Setting this property sets the State property to rdoOofScheduled.
 
 
State One of the rdoOofState  enuyms, read/write.
Specifies the state of the OOF rule (disabled, enabled, or scheduled).
 
rdoOofDisabled = 0
rdoOofEnabled = 1
rdoOofScheduled = 2
 
 

Methods


BeginUpdate Calling this method tells the RDOOutOfOfficeAssistant object that it should not save the OOF immediately, but rather only when EndUpdate is called.
The number of calls to BeginUpdate and EndUpdate must match.
 
 
EndUpdate Calling this method tells the RDOOutOfOfficeAssistant object that it should save the OOF immediately.
The number of calls to BeginUpdate and EndUpdate must match.