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
SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASKER CERTIFIED SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of sydneyguy
sydneyguy
Flag of Australia image

ASKER

yep thanks for that
objmail.SentOnBehalfOfName = works perfectly so thanks for the assistance
Avatar of sydneyguy
sydneyguy
Flag of Australia image

ASKER

thanks for the help
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo