Programmatically fill information in From field when sending message... (USING IMAP)

M

ME

(USING IMAP)

I'm trying to find a workaround to a bug in Outlook 2002 Rule Wizard, and
what I need to do is be able to intercept Private Sub
Application_ItemSend(...) to add the e-mail address of the sender. This is
what I have tried, but didn't work (Using IMAP):

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Item.SentOnBehalfOfName = "John Doe ([email protected])"
End Sub

The other choice is to intercept Private Sub Application_NewMail() and try
to do the same thing.

The last resort would be to create a custom form and hard code the From
field, but when I tried to edit the message form and create a custom copy,
some features get disabled, such as View -> Bcc, etc.

I read somewhere that Item.SentOnBehalfOfName(...) only works when
connecting to an Exchange Server. I don't understand why something as simple
as this task requires an Exchange Server to work. It's kind of stupid.

Any ideas???
 
K

Ken Slovak - [MVP - Outlook]

NewMail only fires at intervals and only for incoming emails.

SentOnBehalfOf would only apply with Exchange Server because without
it you are the sole user of Outlook.

If you have an email account that has the sender address you want to
use to send the item you can use code to execute the
CommandBar.Control object that represents the Accounts button in an
Outlook 2002 email's Inspector in the Standard toolbar before the item
is sent out.

See http://www.slipstick.com/dev/code/autobcc.htm for some examples of
adding a BCC address to an email. That code can be used as a starting
point for what you want to do.
 

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