Catching the reply event

A

andy_occ

Hello all,

I need to catch the reply event, by which i mean i need to know when a
user pushes the reply button.
In addition, I need to have access to the mail the users wishes to
reply to.

Basically, what I want to do is whenever the user replies to a mail,
sent to "(e-mail address removed)", the reply mail has to be mangled to
have "(e-mail address removed)" as sender address, despite the user having
"(e-mail address removed)" as primary address. (In this scenario I have
the secretary, who has full access and rights to the employees
mailbox; she has to be able to reply posing as the employees).

I'm using VS 2005 with VSTO extensions; I am able to catch quite alot
of events.
I can catch the ItemAdded event in the Outbox, but the addedItem
object that I'm getting is not a MailItem ???

(Alternatively, if someone could just tell me how to setup Outlook /
Exchange rights in such a way that the "send as" works (and not the
"send on behalf of") that would be equally helpful)

I hope somebody can help me out here !

Thanks in advance,

Andy
MCP
 
K

Ken Slovak - [MVP - Outlook]

Send As permissions are set on the server and how you do that differs
depending on what version of Exchange you are using. That's a server
question best asked in an Exchange group, providing the required information
such as version, not a programming group.

The NewInspector event of the Inspectors collection will fire every time a
new item is opened. If Inspector.CurrentItem.Class = olMail then it's a mail
item.

To handle the reply event you would need to handle MailItem events in all
open email Inspectors in case the user hit reply from an open email. The
MailItem.Reply event would do that for you.

In addition, you would also need to handle events in case the user hit reply
while an email is selected in a folder view (Explorer). For that you need to
handle the SelectionChange event in the ActiveExplorer. You would check to
see if ActiveExplorer.CurrentFolder was a mail folder and if so get the
Selection collection. For every email selected you would instantiate a
MailItem object declared WithEvents and then set up to handle the Reply
event of the selected emails.

Take a look at the code samples for whatever language you are using and for
VSTO at www.outlookcode.com, many of them show event handling.
 

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