Inserting sender name and address with vba

Status
Not open for further replies.

Dean Waring

New Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
I am trying to create emails using vba. I get the email created with the To:, Subject:, Body:, and attachments just fine but none of the examples that I've searched and researched seem to show the sender's name, address, phone or anything like that. For instance:

Public Sub sendmeTest()
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim obj As Outlook.MailItem

Set objOutlook = GetObject(, "Outlook.Application")

Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
Set objOutlookRecip = .Recipients.Add("John.Smith@td.com")

objOutlookRecip.Type = olTo
.Subject = "Monthly Reports"
.Body = "Attached are this month's monthly reports. Let me know if you have any questions."
.CC = "Allison.Jones@td.com"
.Importance = olImportanceNormal
DisplayCurrentUser


' .Send
.Display
End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
Set objOutlookRecip = Nothing
Exit Sub
End Sub

This creates the email very nicely, but doesn't have sender details. Any thoughts?
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
Witzker Pls help to change the code for inserting date in Ol contact body Outlook VBA and Custom Forms 5
W Inserting Additional Email Address Outlook VBA and Custom Forms 4
G Message template / custom forms and VBA Help needed - inserting info into table Outlook VBA and Custom Forms 3
D Using Libraries when inserting a file in Outlook 2013 Using Outlook 1
L Inserting a PPT/PDF into the message body Using Outlook 1
B Outlook 2007 - Slow opening folders when inserting attachments Using Outlook 2
S Inserting Dates With Quick Parts (or Macros) Using Outlook 4
L Block others from inserting appointments in your calendar Using Outlook 3
W inserting activeX/user control into form Outlook VBA and Custom Forms 1
H C# inserting word document with formatting into outlook message Outlook VBA and Custom Forms 1
R Inserting a hyperlink in the bod of an outlook appt. Outlook VBA and Custom Forms 13
K Inserting text from a macro Outlook VBA and Custom Forms 1
D Outlook VBA forward the selected email to the original sender’s email ID (including the email used in TO, CC Field) from the email chain Outlook VBA and Custom Forms 2
A Outlook 2019 Help with forwarding email without mentioning the previous email sender. Outlook VBA and Custom Forms 0
C Outlook 365 Copy/Save Emails in Folder Outside Outlook to Show Date Sender Recipient Subject in Header Using Outlook 0
L Checking Sender Email Address for trusted domain from list on intranet Outlook VBA and Custom Forms 4
F Forward incoming email with 4 embedded images in the body without original sender Outlook VBA and Custom Forms 22
R Capture Sender's Display name and Address Outlook VBA and Custom Forms 3
T Junk Email does not get added to the Blocked Sender List Using Outlook 0
M How create a Rule to filter sender's email with more that one @ sign Using Outlook 1
F Junk Email does not get added to the Blocked Sender List Using Outlook 4
U Outlook 2016 Outlook 2016 sender name Using Outlook 1
C Macro to extract sender name & subject line of incoming emails to single txt file Outlook VBA and Custom Forms 3
Terry Sullivan Sender's Name Doesn't Appear in the From Field on Outlook 365/IMAP Using Outlook 2
K Use VBA to find Sender and Recipient from Microsfot 365 Journaled Email Items Outlook VBA and Custom Forms 3
Terry Sullivan Sender Field Displays My E-Mail Address, Not My Name Using Outlook 1
J Autoreply email recieved from specific sender after deleting some text from body. Using Outlook 0
D Reply with a template loose the sender's embedded image Outlook VBA and Custom Forms 0
J Outlook 2016 How tell Outlook not to trust sender? Using Outlook 1
M Screen Scrape Sender IP Address Outlook VBA and Custom Forms 6
S Meeting Invite arrives from Wrong ("send-as") Sender Using Outlook 1
icacream Rule based on sender / wrong sender sent to folder Using Outlook 7
D Moving Emails Based on Recipient/Sender Outlook VBA and Custom Forms 4
B Looking to filter (or just find/search) for only messages that the sender has sent more than 1 messa Using Outlook 2
I How to display sender's name instead of email address in outlook 2013 message Using Outlook 5
A Sort emails into subfolders based on sender and deleting emails automatically Outlook VBA and Custom Forms 3
C Display Sender As Contact Outlook VBA and Custom Forms 4
Ed Sheehan Unusual behaviour in setting Sender (Outlook 2016) Outlook VBA and Custom Forms 4
J Auto Forward - Include Attachment and change Subject depending on original sender Outlook VBA and Custom Forms 3
Q Undisclosed recipients does not include sender Using Outlook 1
M Move new mail to folder based on sender address Outlook VBA and Custom Forms 2
M Blocked Sender List @Domain Not Working Using Outlook 0
P MS OUTLOOK 2013 - Adding Sender on the CC line Using Outlook 5
J Saving attachments from specific sender (phone number) to specific folder on hard drive Using Outlook 3
B Can't expose sender email address when linking outlook to access Using Outlook 3
Diane Poremsky Use VBA to create an Outlook Search Folder for Sender Using Outlook 0
K Extract email to excel from a specific sender Outlook VBA and Custom Forms 3
D Change sender name outlook vba 2010 Custom Userform Outlook VBA and Custom Forms 1
O See recent emails from a sender Using Outlook 2
S announce email sender and subject when new email arrives... Using Outlook 7

Similar threads

Back
Top