mjohnston0209
Board Regular
- Joined
- Nov 6, 2017
- Messages
- 55
Every week, I send out several emails with updated reports and hyperlinks. To save time, I created a macro to write and send these emails for me. The generated email is exactly what I want when I display the message. However, I noticed that after the email is sent, my automatic signature appears at the top of the message. How can I reposition the signature to appear at the bottom of the message after it is sent as it does when I create an email through normal methods?
Below is the code I use.
Thanks!
Below is the code I use.
VBA Code:
Sub send_VPemails_complete()
Dim i As Integer, Mail_Object, Email_Subject, o As Variant, lr As Long, source_file, strbody As String
lr = Range("A20").End(xlDown).Row
Set Mail_Object = CreateObject("Outlook.Application")
For i = 20 To lr
source_file = "W:\Accounting\Financial Reporting\2021 Financial Statements\01.2021\F - Cost Center Statements & Job Performance Reports\F402 Job Analysis\Portfolio\VP\" & Cells(i, 7) & "\" & Cells(i, 4)
strbody = Cells(i, 2) & "," & "<br>" _
& "<br>" _
& "Attached is a PDF summarizing the weekly change (" & Cells(i, 5) & " vs " & Cells(i, 6) & ") for all " & Cells(i, 8) & " active projects." & "<br>" _
& "<br>" _
& "Please contact me with any questions." & "<br>" _
& "<br>" _
& "Thanks,"
With Mail_Object.CreateItem(o)
.Subject = Cells(i, 3)
.To = Cells(i, 1)
.HTMLBody = .HTMLBody & strbody
.Attachments.Add source_file
.Send
End With
Next i
MsgBox "E-mails successfully sent", 64
Application.DisplayAlerts = False
End Sub
Thanks!