'Remove recipients from Outlook email if automatic reply is activated

I have a VBA script that generate and send an email. Sometimes some of the recipients of the email are out of office and have an Automatic Reply turned on. Since the content of the email is not relevant to somebody that is out of office I would like to delete the those specific recipients. All email recipients are in the same MS Exchange server. Is there anyway to perform this operation? Thanks



Solution 1:[1]

You can either

  1. use Exchange Web Services API to retrieve the OOF status

  2. use Extended MAPI (C++ or Delphi only) to open the other user's mailbox (IMsgStore) and read the PR_OOF_STATE property.

  3. Use Redemption (any language; disclaimer: I am Redemption developer) and use RDOExchangeMailboxStore.OutOfOfficeAssistant or read the PR_OOF_STATE property using RDOStore.Fields[]. To open other user's mailbox, you can use RDOSession.GetSharedMailbox.

  4. UPDATE. Note that #2 and #3 require access rights to the mailbox in question. You can do what Outlook does when it displays the mail tip in a banner when a recipient you are about to send to is OOF. Use EWS and GetMailTips operation. Redemption exposes this functionality through RDOAddressEntry.GetMailtips and RDOMailTips object.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1