PDA

View Full Version : [SOLVED:] Trigger event - changing sender



auto_mach
05-13-2015, 11:38 AM
I'm wondering what the trigger events are in outlook. Specifically, is there a trigger when the sender is changed?

I am able to send emails from different mailboxes and would like to write a small script to change some settings depending on which address I will be sending from.

I keep forgetting to do certain small things that can get to be pretty aggravating and what I would like to do is have a macro disable the delivery and read receipts when I select a different sender.

Perhaps there's another way? : pray2:

skatonni
05-14-2015, 02:48 PM
Extend the code to include choosing the sender.

Use SentOnBehalfOfName when creating or replying or forwarding.


Option Explicit

Sub SentOnBehalf_create()

Dim objMsg As MailItem
Set objMsg = Application.CreateItem(olMailItem)
objMsg.SentOnBehalfOfName = "Sender address"

' code to disable the delivery and read receipts

objMsg.Display

ExitRoutine:
Set objMsg = Nothing

End Sub

Note: You cannot set "From" manually and wait until Application_ItemSend. SentOnBehalfOfName will be empty.

auto_mach
05-19-2015, 07:32 AM
Awesome, I think this is the way it will work. I suppose this way I'll also avoid forgetting to change the sender name. :P

Thanks!