I want to automatically reply to emails with an address other than the one used mainly in VBA installed in Outlook.
At that time, the phrase "(main address) is sent on your behalf" is inevitably included in the reply email.
If anyone has any information on how to get rid of this wording, would you please tell me?
.SentOnBehalfOfName = "
.To = "mail address"
.Subject = "email subject"
.Body = "email body"
.BodyFormat = olFormatPlain'Mail format
-The version of Microsoft Office will be 2019.
-The sender address I want to change is the address added to Outlook.
-It was not displayed when the sender was changed manually.
・ The mail server is "Name.com"
Answer # 1
I solved it by adding the syntax to switch the account itself as follows.
Dim objOutlook As Outlook.Application
Dim objMail As Outlook.MailItem
Dim ObjAccount As Object
Set objOutlook = New Outlook.Application
Set objMail = objOutlook.CreateItem (olMailItem)
Set ObjAccount = objOutlook.Session.Accounts.Item ("mail account")'From account setting
～～ Labor saving ～～
.SendUsingAccount = ObjAccount'Switch sender account
- vba : Error "Compile Error: Method OR Data Member Not Found" when you start macro in Outlook
- vba : How to get the mail subject, if it consists of Chinese characters?
- vba - application_newmailex event does not fire
- i want to use excelvba to send emails to multiple contacts at once while changing the text content and destination
- i want to get a shared calendar in outlook with excel365 vba, but when i reach a certain number of people, i can't get the folde
- vba - i want to improve the problem that outlook mail cannot be output to excel
- extracting tables in outlook email body with excel vba
- when an email with a specific character string in the subject of outlook vba arrives, write the text to excel
- vba:i want to paste a specific range of values into the body of an outlook email