I have some code that automatically sends a HTML formatted email from Access. What I would like to additionally accomplish is changing the "FROM" column programatically. The email should be coming from a group mailbox but whoever is clicking the button, will be captured as the sender. Is there a way I can program that using VBA? Here is what I have below that works fine except the email comes from me. Thanks in advance for any help.
Code:
Dim olApplication As Outlook.Application
Dim olns As Outlook.NameSpace
Dim myItem As Outlook.MailItem
Set olApplication = CreateObject("Outlook.Application")
Set olns = olApplication.GetNamespace("MAPI")
Set myItem = olApplication.CreateItem(olMailItem)
myItem.HTMLBody = "<HTML><BODY><P>Fannie Mae Hiring Manager/ Point of Contact:</P>"
myItem.Subject = theSub
myItem.Display
myItem.To = "" & theVendor
myItem.cc = "" & theCC