Determining account being used

S

Scott

In the Item.Send event, I am creating and sending a new message that
will be of type RDOMail.

What I need to be able to do is set the Account based on the account
selected in the Inspector winudow. From the Item.Send Event, I have
the original message as type Outlook.Mailitem.

How do I determine the account selected? Is there a way I can do it
from SafeMailItem, or a way that I can hand the Outlook.MailItem off to
RDOMail which has an Account property? (actually I tried to go from
Outlook.MailItem to SafeMailItem to RDOMail, but the .Account property
is Nothing.)

Thanks,

Scott
 
D

Dmitry Streblechenko

Try something like the following

MailItem.Save 'to make sure EntryId is available
EntryID = MailItem.EntryID
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT 'Outlook 2002 and up
only
set Mail = Session.GetMessageFromID(EntryID)
set Account = Mail.Account

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top