2

I have existing VBA code that performs some tasks on a selected email. This is ok. I have two mailboxes in Outlook 2013.

What I need to determine when I execute the VBA code is which mailbox the selected email is from; Mailbox1 or Mailbox2.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Jeffrey
  • 31
  • 3

1 Answers1

3

Use MailItem.Parent (returns MAPIFolder object), then use MAPIFolder.Store.Name to figure out the name of the current store.

If you actually need to figure out the address of the store's owner, you will need to use Extended MAPI (C++ or Delphi only) or Redemption (I am its author) - use RDOExchangeMailboxStore.Owner.Name.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78