Avatar of sydneyguy
sydneyguyFlag for Australia asked on

ms outlook change the from email sent from using vba code

have my out look that i use to send out a 20 -30 emails for work, and when it arrives it says from peter@abc.com , but need to say that the email comes from john@abc.com
i am composing the email out of a DB and building it in the back end as below but cannot see how to change the email from in the header even though  i have the other email set up in the email account, were is the default setting to set this up
any help would be appreciated
using outlook 2003


               Dim olapp As Outlook.Application
               Dim objmail As Outlook.MailItem
               Dim pos As Integer
               Set olapp = Outlook.Application
               Set objmail = olapp.CreateItem(olMailItem)
               objmail.BodyFormat = olFormatRichText
OutlookMicrosoft AccessVisual Basic Classic

Avatar of undefined
Last Comment
sydneyguy

8/22/2022 - Mon
SOLUTION
Scott McDaniel (EE MVE )

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER CERTIFIED SOLUTION
Jeffrey Coachman

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
sydneyguy

yep thanks for that
objmail.SentOnBehalfOfName = works perfectly so thanks for the assistance
ASKER
sydneyguy

thanks for the help
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes