Link to home
Start Free TrialLog in
Avatar of nicksbell
nicksbell

asked on

How do I change the FROM address in Outlook 2007 using VBA

I have written some VBA code to send an email from Excel 2007 using Outlook.Application and Outlook.MailItem.  My outlook is set up to access my exchange account but I have Send As permission to send from another account.  

Can anyone tell me how to change the From field to the Send As address using VBA.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nicksbell
nicksbell

ASKER

I had tried that but when the email was displayed the From box was blank so I assumed it didn't work.  However, after your reply I tried sending it and low and behold it worked.

Thanks for your help.
I think you use the .SenderEmailAddress property of the mail object.

So:-

obj.SenderEmailAddress = "someone@example.com"
You're welcome.
SenderEmailAddress is a read-only property.  But its fine, as long as it goes from the right address I'm good.