A
Antonio
I am using the following to send an email from Excel.
I would like to add a signature to the email. I have a signature for the
default email account and another one, identical, named "Default Signature"
but no signature comes up.
Thanks.
Sub send_email_confirm_traded_with_BGTrade()
Dim to_recipient, side As String
Dim objOL As New Outlook.Application
Dim objMail As MailItem
Set objOL = New Outlook.Application
Set objMail = objOL.CreateItem(olMailItem)
Worksheets("SPLIT").Activate
Application.Calculation = xlCalculationManual
Select Case UCase(Range("Exchange"))
Case "US"
to_recipient = "(e-mail address removed)"
Case "UN"
to_recipient = "(e-mail address removed)"
Case "UQ"
to_recipient = "(e-mail address removed)"
Case Else
to_recipient = "(e-mail address removed)"
End Select
If Range("Total_shares_traded") < 0 Then
side = "Sold at "
Else
side = "Bought at "
End If
With objMail
.To = to_recipient
.CC = "trade"
.Subject = Range("name") & ", " & UCase(Range("ticker"))
.BodyFormat = olFormatHTML
.HTMLBody = "<HTML><BODY><B>" & side & Range("currency") & " " &
FormatNumber(Cells(15, 15), 4) & " with Tradebook on " & Range("trade_date")
& "</b><br></br> " & _
"<UL><TABLE border='1' width='230'><TR><TD width='140'>" & _
Cells(12, 13) & "</TD><TD align='right'>" & FormatNumber(Cells(12, 15),
0) & _
"</TD></TR><TR><TD>" & Cells(13, 13) & "</TD><TD align='right'>" &
FormatNumber(Cells(13, 15), 0) & _
"</TD></TR><TR><TD></TD><TD align='right'><B>" & FormatNumber(Cells(11,
15), 0) & "</B></TD></TR></TABLE></UL>" & _
"<br><b> Antonio J. Salcedo<br>Nordkapp</b></br></BODY></HTML>"
.display
Set objMail = Nothing
Set objOL = Nothing
End With
' Call update_inventory("T")
Application.Calculation = xlCalculationAutomatic
End Sub
I would like to add a signature to the email. I have a signature for the
default email account and another one, identical, named "Default Signature"
but no signature comes up.
Thanks.
Sub send_email_confirm_traded_with_BGTrade()
Dim to_recipient, side As String
Dim objOL As New Outlook.Application
Dim objMail As MailItem
Set objOL = New Outlook.Application
Set objMail = objOL.CreateItem(olMailItem)
Worksheets("SPLIT").Activate
Application.Calculation = xlCalculationManual
Select Case UCase(Range("Exchange"))
Case "US"
to_recipient = "(e-mail address removed)"
Case "UN"
to_recipient = "(e-mail address removed)"
Case "UQ"
to_recipient = "(e-mail address removed)"
Case Else
to_recipient = "(e-mail address removed)"
End Select
If Range("Total_shares_traded") < 0 Then
side = "Sold at "
Else
side = "Bought at "
End If
With objMail
.To = to_recipient
.CC = "trade"
.Subject = Range("name") & ", " & UCase(Range("ticker"))
.BodyFormat = olFormatHTML
.HTMLBody = "<HTML><BODY><B>" & side & Range("currency") & " " &
FormatNumber(Cells(15, 15), 4) & " with Tradebook on " & Range("trade_date")
& "</b><br></br> " & _
"<UL><TABLE border='1' width='230'><TR><TD width='140'>" & _
Cells(12, 13) & "</TD><TD align='right'>" & FormatNumber(Cells(12, 15),
0) & _
"</TD></TR><TR><TD>" & Cells(13, 13) & "</TD><TD align='right'>" &
FormatNumber(Cells(13, 15), 0) & _
"</TD></TR><TR><TD></TD><TD align='right'><B>" & FormatNumber(Cells(11,
15), 0) & "</B></TD></TR></TABLE></UL>" & _
"<br><b> Antonio J. Salcedo<br>Nordkapp</b></br></BODY></HTML>"
.display
Set objMail = Nothing
Set objOL = Nothing
End With
' Call update_inventory("T")
Application.Calculation = xlCalculationAutomatic
End Sub