Unusual behaviour in setting Sender (Outlook 2016)

Status
Not open for further replies.

Ed Sheehan

Member
Outlook version
Outlook 2016 32 bit
Email Account
Outlook.com (as MS Exchange)
I have two email accounts set-up. An Outlook Exchange based one, and a MAPI based one linked to my personal domain hosting service.

I created the following simple script to all default new emails to always using the personal account as the sender.

The first new email persists with using the Exchange based account, but all subsequent emails (so long as the first email remains open) work perfectly. As soon as I close the first email, the next one reverts back to the Exchange account. Again, all subsequent new emails default correctly.

What am I missing?

'=========================================================================
' Program: Sender
' Description: Force sending account to a specific item when creating new emails
' Called by: Outlook events
'=========================================================================

' Create evnt monitoring object
Dim WithEvents colInsp As Outlook.Inspectors

' Begin monitoring with application startup
Private Sub Application_Startup()
Set colInsp = Application.Inspectors
End Sub

' Event handler
Private Sub colInsp_NewInspector(ByVal Inspector As Inspector)
If Inspector.CurrentItem.Class = olMail Then

' Create object to hold mail item
Dim objMail As Outlook.MailItem
Set objMail = Inspector.CurrentItem

' Overide sender account with the first account in profile
If objMail.Sent = False Then
objMail.Sender = Outlook.Session.GetAddressEntryFromID("812B1FA4BEA310199D6E00DD010F5402000000804500640020005300680065006500680061006D00000053004D005400500000006500640040006E006100760065006D002E0063006F")
End If
End If
End Sub
 
Last edited by a moderator:

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
I believe the problem is that Exchange is a pig and always wants to be the sender. <g> I'm seeing the same behavior. What's interesting is the entry id is comping up with your name and address - i will edit the entry id in your sample to remove it.
 

Ed Sheehan

Member
Outlook version
Outlook 2016 32 bit
Email Account
Outlook.com (as MS Exchange)
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
D Unusual calendar issue Exchange Server Administration 0
C Unusual Signature & Spell Check Query Using Outlook 1
S Event ID 9877 - Content Indexing function 'CISearch::EcGetRowsetAndAccessor' received an unusual and Exchange Server Administration 1
F Unusual error: 0x80040403 along with "The folder is full" kiss of death. Using Outlook 2
L Outlook/O365 "sent on behalf" behaviour Exchange Server Administration 1
M Expected behaviour of recurring appointments? Using Outlook 2
Justo Horrillo It's possible to modify the behaviour of the conversation option? Using Outlook 2
R Outlook 2013 - Odd Sync behaviour Using Outlook 1
wallisellener BCM - Weird behaviour BCM (Business Contact Manager) 20
U Odd behaviour for auto-receive Using Outlook 2
E Exchange 2010 - after sending a draft it is still available in the Dumpster - is this behaviour by design? Exchange Server Administration 4
G Outlook 2007 appointment reschedule - strange behaviour in invitee calendars Using Outlook 1
J Reminder snooze default behaviour changed in Outlook 2010 Using Outlook 1
D Strange behaviour of pop account. Exchange Server Administration 3
B [Outlook Connector]catastrophic behaviour when associating external mail account with several mail-adresses Using Outlook 3
H Erratic Rule Behaviour Using Outlook 4
K Strange behaviour with (filesystem-)saved Mails (Ex 2010 with OL2k3/OL2k7) Exchange Server Administration 6
J Using Group Policy to control Outlook security/attachments behaviour Outlook VBA and Custom Forms 1
A click on contact behaviour Outlook Wishlist 2
T Outlook 2003 Categories behaviour Outlook VBA and Custom Forms 1
S Strange Behaviour of Explorer Object. Outlook VBA and Custom Forms 1
P OWA Settings->Calendar->Events from Email; Setting changes do not hold Using Outlook 1
Marc2019 Setting up an Outlook Account on Mac Os 10.6.8 Outlook 2011 Using Outlook 1
L Outlook Office 365 client: won't remember my setting File, not to collapse ribbon Using Outlook 2
M Where is the setting to *turn off* open calendar in a new window? Using Outlook 3
llama_thumper Setting up forwarders on Exchange server Exchange Server Administration 0
B Setting rules Using Outlook 1
C iCloud Setting missing Outlook tab and Outlook missing the iCloud refresh button Using Outlook 4
B Setting defaults Using Outlook 2
C need help setting up outlook first time Using Outlook 1
P Reading Pane (Reading Pain?) Default Setting Using Outlook 1
W Setting up a custom form Outlook VBA and Custom Forms 2
mctabish Setting "Reply To" based on inbox Outlook VBA and Custom Forms 2
R Setting font and color used when replying to an email Outlook VBA and Custom Forms 3
M Setting flag follow up for next business day Outlook VBA and Custom Forms 1
Jennifer Murphy Equations don't comply with style setting to left justify Using Outlook 0
J Setting default address book Using Outlook 0
N Does a Shared Folder Policy override a Digital Signature Setting for macros? Outlook VBA and Custom Forms 6
Diane Poremsky Setting up an Outlook.com IMAP account New Slipstick.com Articles 0
Diane Poremsky Setting the default Country for Outlook Contacts New Slipstick.com Articles 0
H Need help setting up GetFolderPath-Makro with Vodafone IMAP Mail-Account Outlook VBA and Custom Forms 0
Diane Poremsky Adjusting Outlook's Zoom setting in Email New Slipstick.com Articles 0
O Setting default format for composing/replying to emails Using Outlook 3
B Outlook Calendar/setting appointments Using Outlook 1
Diane Poremsky Adjusting Outlook's Zoom setting in Email New Slipstick.com Articles 0
Diane Poremsky Setting Custom Reminder Times New Slipstick.com Articles 0
A Can't stop Outlook.com from setting reminders on appointments? Using Outlook.com accounts in Outlook 3
A Setting RULES with more than one condition in MS OUTLOOK Using Outlook 6
L Setting up my PA's Outlook Using Outlook 7
E Need Help on Setting up a repeated Reminder on Task with Reoccurence Every Year Using Outlook 6
Similar threads


















































Top