Hi all,
I have the following VBA code working correctly, except for the wierd placement of the attached pdf in the body of the email.
Here is the pertinent code.
Here is a picture of the outgoing email. The attachment sits in between the closing and the sender's signature.
Any ideas on how to get it to be situated at the top of the message body?
Thanks for the advice!
MIB
I have the following VBA code working correctly, except for the wierd placement of the attached pdf in the body of the email.
Here is the pertinent code.
Code:
'Build email variables
strTo = Me.txtSContactEmail
Debug.Print "Email to " & strTo
strTo = Left(strTo, InStr(strTo, "#mailto") - 1)
Debug.Print "Email to " & strTo
'Get cc info
Dim BContactEmail
BContactEmail = Me.txtBContactEmail
BContactEmail = Left(BContactEmail, InStr(BContactEmail, "#mailto") - 1)
Debug.Print BContactEmail
'if TTT is Ad Buyer, add tim to cc list
Dim AddCC
If BCompanyID = 463 Then
AddCC = "tim@#####tionteam.com"
Else
AddCC = ""
End If
strCC = "##keting.com; " & BContactEmail & "; " & AddCC
strSubject = Me.txtFileName
strBody = Me.txtFirstName & ", attached is the "
If CkforRevision = True Then
strBody = strBody & "REVISED "
End If
strBody = strBody & "Insertion Order for " & txtPeriod & "." & vbNewLine & vbNewLine & _
"Please review, sign and return. " & vbNewLine & vbNewLine & _
"Thanks," & vbNewLine & vbNewLine & _
"Mark"
If oOutlook Is Nothing Then
Set oOutlook = New Outlook.Application
End If
'Set up message
Set oEmailITem = oOutlook.CreateItem(olMailItem)
With oEmailITem
.Attachments.Add strFilePath
.To = strTo
.CC = strCC
.Subject = strSubject
.Body = strBody
.Display
End With
Here is a picture of the outgoing email. The attachment sits in between the closing and the sender's signature.
Any ideas on how to get it to be situated at the top of the message body?
Thanks for the advice!
MIB
Last edited: