"From" field extraction

D

DG

In Outlook 2003, is it possible to programmatically read the "From" field of
a MailItem BEFORE the e-mail is sent out?
I've written a new "Send" utility and I noticed that the From field
properties are not visible until after the e-mail has been sent. I've tried
saving it in Exchange to the Drafts folder, I've tried saving it to the C:\
drive as a MSG file, but nothing. "From" is simply NULL.

Any ideas?
Thanks,
Doug
 
D

Dmitry Streblechenko

In theory, yes. If the user has not explicitly set the Account drop down
prior to clicking Send, it will be the same as Namespace.CurrentUser.
Otherwise you can read a couple of named propeties using MAPI (C++/Delphi),
then use the IOlkAccountManager to find the corresponding account and read
the name and address of that account.
Outlook 2007 exposes the account used to send the message through the
MailItem.SendUsingAccount property.
<plug> Redemption exposes RDOMail.Account property (works in Outlook 2002
and up) - see http://www.dimastr.com/redemption/rdo/RDOMail.htm#properties
and http://www.dimastr.com/redemption/rdo/RDOAccount.htm </plug>

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