LaurieLundstrom
New Member
- Joined
- Sep 18, 2019
- Messages
- 1
Hello Experts!
I am using the following to successfully create an email and attach a pdf to it. All works great, except the email signature does not show.
I believe the signature is being replaced with the body text.
outlookmailitem.body="Hello,".....
I am very new to macros (less than 24 hours). Please be real specific and don't assume I know anything. Thanks,
Sub CreateEmail()
Dim edress As String
Dim cc As String
Dim subj As String
Dim message As String
Dim filename As String
Dim outlookapp As Object
Dim outlookmailitem As Object
Dim myAttachments As Object
Dim path As String
Dim attachment As String
Set outlookapp = CreateObject("Outlook.Application")
Set outlookmailitem = outlookapp.createitem(0)
Set myAttachments = outlookmailitem.Attachments
path = "C:\Users\llundstrom\Desktop\Quotes\"
edress = ActiveSheet.Range("c46")
cc = Sheets("Formulas & Macros").Range("a27")
subj = ActiveSheet.Range("c4")
filename = ActiveSheet.Range("c48")
attachment = path + filename
outlookmailitem.To = edress
outlookmailitem.cc = cc
outlookmailitem.bcc = ""
outlookmailitem.Subject = subj
outlookmailitem.body = "Hello," & vbCrLf & "Please find your quote attached." & vbCrLf & "Thanks,"
myAttachments.Add (attachment)
outlookmailitem.display
End Sub
I am using the following to successfully create an email and attach a pdf to it. All works great, except the email signature does not show.
I believe the signature is being replaced with the body text.
outlookmailitem.body="Hello,".....
I am very new to macros (less than 24 hours). Please be real specific and don't assume I know anything. Thanks,
Sub CreateEmail()
Dim edress As String
Dim cc As String
Dim subj As String
Dim message As String
Dim filename As String
Dim outlookapp As Object
Dim outlookmailitem As Object
Dim myAttachments As Object
Dim path As String
Dim attachment As String
Set outlookapp = CreateObject("Outlook.Application")
Set outlookmailitem = outlookapp.createitem(0)
Set myAttachments = outlookmailitem.Attachments
path = "C:\Users\llundstrom\Desktop\Quotes\"
edress = ActiveSheet.Range("c46")
cc = Sheets("Formulas & Macros").Range("a27")
subj = ActiveSheet.Range("c4")
filename = ActiveSheet.Range("c48")
attachment = path + filename
outlookmailitem.To = edress
outlookmailitem.cc = cc
outlookmailitem.bcc = ""
outlookmailitem.Subject = subj
outlookmailitem.body = "Hello," & vbCrLf & "Please find your quote attached." & vbCrLf & "Thanks,"
myAttachments.Add (attachment)
outlookmailitem.display
End Sub