Sign in to follow this  
Followers 0
exodius

Outlook Redemption VBScript Translation

3 posts in this topic

Could someone help me with what I should be putting differently in this translation?

Taking this code from the Outlook Redemption website:

skPrimaryExchangeMailbox = 3
skDelegateExchangeMailbox = 4
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 OOFAsistant = Store.OutOfOfficeAssistant
  OOFAsistant.OutOfOffice = true
  OOFAsistant.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

I came up with:

$skPrimaryExchangeMailbox = 3
$skDelegateExchangeMailbox = 4

$oOutlook = ObjCreate("Outlook.Application")
$oSession = ObjCreate("Redemption.RDOSession")
$oSession.MAPIOBJECT = $oOutlook.Session.MAPIOBJECT
$oStore = $oSession.Stores.DefaultStore
if $oStore.StoreKind = $skPrimaryExchangeMailbox or $oStore.StoreKind = $skDelegateExchangeMailbox Then
  $OOFAssistant = $oStore.OutOfOfficeAssistant
  $OOFAssistant.OutOfOffice = true
  $OOFAssistant.OutOfOfficeText = "Sorry, I am out of office at the moment!"
Else
  MsgBox (0, "", "Out Of Office Assistant is only available for the Exchange mailboxes")
EndIf

But it doesn't so much work.I'm pretty sure my implementation is off where I reference $oOutlook.Session.MAPIOBJECT, but I don't know what else to put there. Any thoughts?

Share this post


Link to post
Share on other sites



Please search the forum for "MAPIOBJECT" and/or "Redemption.RDOSession". There are some hits that might help you.

I'm not good with Outlook, just with the search function :blink:


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Figured it out, seems like the example on their website must not be updated to the latest syntax or something...

Here's what resolved it for me:

$skPrimaryExchangeMailbox = 3
$skDelegateExchangeMailbox = 4

$oSession = ObjCreate("Redemption.RDOSession")
$oSession.Logon
$oStore = $oSession.Stores.DefaultStore
if $oStore.StoreKind = $skPrimaryExchangeMailbox or $oStore.StoreKind = $skDelegateExchangeMailbox Then
  $OOFAssistant = $oStore.OutOfOfficeAssistant
  $OOFAssistant.OutOfOffice = true
  $OOFAssistant.OutOfOfficeText = "Sorry, I am out of office at the moment!"
Else
  MsgBox (0, "", "Out Of Office Assistant is only available for the Exchange mailboxes")
EndIf

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0