Send As Property Outlook VBA

M

mac7attack

Hello all,

Is there a VBA property for a mailitem to change the Send As field? I
would like for the email to come from my team's group mailbox and not
the user who is running the script. My test code as follows.
The SenderEmailAddress property returns a Read-only run-time error.


Sub TestEmail()
Dim position As Long
Dim OLobj As Object
Dim Mailobj As Object
Dim BodyStr As String
Dim SectStr As String


Set OLobj = CreateObject("Outlook.Application")
Set Mailobj = OLobj.CreateItem(olMailItem)
With Mailobj
'.Senderemailaddress = "(e-mail address removed)"
.To = "(e-mail address removed)
.Subject = "Testing VBA"
.Body = "Testing"
.Send
End With

Set Mailobj = Nothing
Set OLobj = Nothing

End Sub

Thanks in advanced,

Matt
 
S

Sue Mosher [MVP-Outlook]

If you're referring to an Exchange mailbox, use the MailItem.SentOnBehalfOfName property.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top