Not able to add default Signature

G

Guest

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
 
M

Michael Bauer

Am Wed, 10 May 2006 12:29:01 -0700 schrieb Antonio:

Please display the Item first and add your text to the body (instead of
overwriting the body): Sample:

..HTMLBody = YourText & .HTMLBody
 
G

Guest

Hi Michael,

Thank you for your help.

I have tried what you mention but it does not work.

I can manage to get the default signature if I do not have any Body. I also
get the inconvenient message "another pogram is trying to access Outlook".

As soon as I enter an .HTMLBody it overwrites the signature.

Can you give me a specific code example.

Much obliged.

Antonio
 
M

Michael Bauer

Am Thu, 11 May 2006 02:13:01 -0700 schrieb Antonio:

I gave you a sample. Please pay attention to the last line of my former
message. You need to replace "YourText" by whatever you want to write, of
course.
 
G

Guest

I have tried:

With objMail
.To = to_recipient
.CC = "trade"
.Subject = Range("name") & ", " & UCase(Range("ticker"))
.BodyFormat = olFormatHTML

.display

.HTMLBody = "text" & .HTMLBody


Set objMail = Nothing
Set objOL = Nothing

End With


but although I get the signature, I see no body text
 
M

Michael Bauer

Am Thu, 11 May 2006 06:14:02 -0700 schrieb Antonio:

Antonio, if your code doesn´t raise an error there´s no way arround: The
following line can´t write the HTMLBody into HTMLBody without also writing
"text" into it.
.HTMLBody = "text" & .HTMLBody

Do you use an "On Error Resume Next" statment? If so, what happens if you
comment that out?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top