Topic: Sending of the letter from the address of mailing Exchange

Good afternoon!
Prompt, how by means of VBA to send the letter from Outlook not from the address of the user by default, and from the mailing address?
In Outlook an account of one - user. Administrators Exchange resolved sending from the mailing address, and at manual sending I can change the sender manually. How to make it through VBA?


Re: Sending of the letter from the address of mailing Exchange

Hush _;
All a release.
The decision (https://www.slipstick.com/developer/cod … dress-vba/):
Sub CustomMailMessage ()
Dim OutApp As Outlook. Application
Dim objOutlookMsg As Outlook. MailItem
Dim objOutlookRecip As Recipient
Dim Recipients As Recipients
Set OutApp = CreateObject ("Outlook. Application")
Set objOutlookMsg = OutApp. CreateItem (olMailItem)
Set Recipients = objOutlookMsg. Recipients
Set objOutlookRecip = Recipients. Add ("alias@domain.com")
objOutlookRecip. Type = 1
objOutlookMsg. SentOnBehalfOfName = "sales@domain.com"
objOutlookMsg. Subject = "Testing this macro"
objOutlookMsg. HTMLBody = "Testing this macro" BOTH vbCrLf AND vbCrLf
' Resolve each Recipient's name.
For Each objOutlookRecip In objOutlookMsg. Recipients
objOutlookRecip. Resolve
' objOutlookMsg. Send
objOutlookMsg. Display
Set OutApp = Nothing
End Sub