Hi All,
I'm attempting to include my default signature into an Outlook email that is created from a macro I have in a workbook. So far, I have code that can create an email, add the necessary recipients, add the necessary attachment, and add the necessary body to my email. However, the .Body part of the code overwrites everything in my email, including the default signature. Can anyone help me so that .Body part of my code does not overwrite the signature in my email? See code here:
Here is the issue as I see it: Once my mail item is created, I can see where my Outlook signature is included. However, once the code gets to the .Body part, it replaces the entire email (that is, the default signature) with the range in cell D2. I've tried changing
to
which does include the signature, but this also erases all formatting. Is there a way I can modify original coding to include default signature, and not affect formatting of the contents in .Range("D2")?
Thanks a bunch!
I'm attempting to include my default signature into an Outlook email that is created from a macro I have in a workbook. So far, I have code that can create an email, add the necessary recipients, add the necessary attachment, and add the necessary body to my email. However, the .Body part of the code overwrites everything in my email, including the default signature. Can anyone help me so that .Body part of my code does not overwrite the signature in my email? See code here:
Code:
Set apOutlook = CreateObject("Outlook.Application")apOutlook.Session.Logon
Set itEmail = apOutlook.CreateItem(olMailItem)
With itEmail
.Display
.To = Worksheets("Distribution List").Range("B2")
.CC = Worksheets("Distribution List").Range("C2")
.Subject = MonthName(Period) & Worksheets("Distribution List").Range("A2")
.Attachments.Add ("C:\Users\Suunto\Desktop\Attachment.pdf")
.Body = Worksheets("Distribution List").Range("D2")
End With
End Sub
Here is the issue as I see it: Once my mail item is created, I can see where my Outlook signature is included. However, once the code gets to the .Body part, it replaces the entire email (that is, the default signature) with the range in cell D2. I've tried changing
Code:
.Body = Worksheets("Distribution List").Range("D2")
Code:
.HTMLBody = Worksheets("Distribution List").Range("D2") & .HTMLBody
which does include the signature, but this also erases all formatting. Is there a way I can modify original coding to include default signature, and not affect formatting of the contents in .Range("D2")?
Thanks a bunch!