I have a single Outlook email set up on my Outlook account, let's say "example@xxx.com".
I have another "email account", let's say "alias@zzz.net", that serves as nothing more than a pointer to my @xxx.com account.
Outlook has no settings for the pointer account other than my ability to type it into the From field. I have Outlook set up to manually change the From field between @xxx.com and @zzz.net.
Because my @xxx.com email is the actual email, Outlook defaults to that email in the From field. I would like this to be the opposite, i.e. any email I send out has "alias@zzz.com in the From field.
I have attempted with the following code:
Public WithEvents myItem As Outlook.MailItem
Private Sub Application_ItemLoad(ByVal Item As Object)
If (TypeOf Item Is MailItem) Then
Set myItem = Item
End If
End Sub
Private Sub FromField()
With myItem
.SentOnBehalfOfName = "alias@zzz.com"
.Display
End With
End Sub
Private Sub myItem_Open(Cancel As Boolean)
FromField
End Sub
Placing the FromField sub into the Application_ItemLoad did not work.