D
Darrell Lankford
I'm having a problem with my code putting both the email text and the
signature in an Outlook email. If I change any of the .Body, .Display,
or objsigMail it either puts in the text and not the signature, the
signature and not the text, or opens 2 separate emails with one of
each. If anyone can tell be how to fix it so both the message and the
signature will go into the Body of the email, it would be greatly
appreciated.
Thanks,
Darrell
Sub email()
Dim objOL As New Outlook.Application
Dim objMail As MailItem
Set objOL = New Outlook.Application
Set objMail = objOL.CreateItem(olMailItem)
Dim msg As String
Set objsigMail = objOL.CreateItem(olMailItem)
MTL_1 = Range("Material_List_1").Value
MTL_2 = Range("Material_List_2").Value
MTL_3 = Range("Material_List_3").Value
MTL_4 = Range("Material_List_4").Value
MTL_5 = Range("Material_List_5").Value
MTL_6 = Range("Material_List_6").Value
MTL_7 = Range("Material_List_7").Value
MTL_8 = Range("Material_List_8").Value
MTL_9 = Range("Material_List_9").Value
MTL_10 = Range("Material_List_10").Value
SUBJ = Range("Subject").Value
msg = "Lester," & Chr(13) & Chr(13)
msg = msg & "I need a quote or cost point print out for the following:"
& Chr(13) & Chr(13)
msg = msg & "Thanks," & Chr(13)
msg = msg & " Darrell" & Chr(13) & Chr(13)
msg = msg & MTL_1 & Chr(13)
msg = msg & MTL_2 & Chr(13)
msg = msg & MTL_3 & Chr(13)
msg = msg & MTL_4 & Chr(13)
msg = msg & MTL_5 & Chr(13)
msg = msg & MTL_6 & Chr(13)
msg = msg & MTL_7 & Chr(13)
msg = msg & MTL_8 & Chr(13)
msg = msg & MTL_9 & Chr(13)
msg = msg & MTL_10 & Chr(13)
addee = "(e-mail address removed)"
CC = "JAndrews@ Company.com;BarryA@ Company.com"
With objMail
objsigMail.To = addee
objsigMail.CC = CC
objsigMail.BCC = ""
objsigMail.Subject = SUBJ
.Body = msg & objsigMail.Display
End With
Set objMail = Nothing
Set objOL = Nothing
End Sub
signature in an Outlook email. If I change any of the .Body, .Display,
or objsigMail it either puts in the text and not the signature, the
signature and not the text, or opens 2 separate emails with one of
each. If anyone can tell be how to fix it so both the message and the
signature will go into the Body of the email, it would be greatly
appreciated.
Thanks,
Darrell
Sub email()
Dim objOL As New Outlook.Application
Dim objMail As MailItem
Set objOL = New Outlook.Application
Set objMail = objOL.CreateItem(olMailItem)
Dim msg As String
Set objsigMail = objOL.CreateItem(olMailItem)
MTL_1 = Range("Material_List_1").Value
MTL_2 = Range("Material_List_2").Value
MTL_3 = Range("Material_List_3").Value
MTL_4 = Range("Material_List_4").Value
MTL_5 = Range("Material_List_5").Value
MTL_6 = Range("Material_List_6").Value
MTL_7 = Range("Material_List_7").Value
MTL_8 = Range("Material_List_8").Value
MTL_9 = Range("Material_List_9").Value
MTL_10 = Range("Material_List_10").Value
SUBJ = Range("Subject").Value
msg = "Lester," & Chr(13) & Chr(13)
msg = msg & "I need a quote or cost point print out for the following:"
& Chr(13) & Chr(13)
msg = msg & "Thanks," & Chr(13)
msg = msg & " Darrell" & Chr(13) & Chr(13)
msg = msg & MTL_1 & Chr(13)
msg = msg & MTL_2 & Chr(13)
msg = msg & MTL_3 & Chr(13)
msg = msg & MTL_4 & Chr(13)
msg = msg & MTL_5 & Chr(13)
msg = msg & MTL_6 & Chr(13)
msg = msg & MTL_7 & Chr(13)
msg = msg & MTL_8 & Chr(13)
msg = msg & MTL_9 & Chr(13)
msg = msg & MTL_10 & Chr(13)
addee = "(e-mail address removed)"
CC = "JAndrews@ Company.com;BarryA@ Company.com"
With objMail
objsigMail.To = addee
objsigMail.CC = CC
objsigMail.BCC = ""
objsigMail.Subject = SUBJ
.Body = msg & objsigMail.Display
End With
Set objMail = Nothing
Set objOL = Nothing
End Sub