![]() |
Not able to add default Signature
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 = " Case "UN" to_recipient = " Case "UQ" to_recipient = " Case Else to_recipient = " 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 = "HTMLBODYB" & side & Range("currency") & " " & FormatNumber(Cells(15, 15), 4) & " with Tradebook on " & Range("trade_date") & "/bbr/br " & _ "ULTABLE border='1' width='230'TRTD width='140'" & _ Cells(12, 13) & "/TDTD align='right'" & FormatNumber(Cells(12, 15), 0) & _ "/TD/TRTRTD" & Cells(13, 13) & "/TDTD align='right'" & FormatNumber(Cells(13, 15), 0) & _ "/TD/TRTRTD/TDTD align='right'B" & FormatNumber(Cells(11, 15), 0) & "/B/TD/TR/TABLE/UL" & _ "brb Antonio J. SalcedobrNordkapp/b/br/BODY/HTML" .display Set objMail = Nothing Set objOL = Nothing End With ' Call update_inventory("T") Application.Calculation = xlCalculationAutomatic End Sub |
Not able to add default Signature
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 -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.vbOffice.net -- 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 = " Case "UN" to_recipient = " Case "UQ" to_recipient = " Case Else to_recipient = " 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 = "HTMLBODYB" & side & Range("currency") & " " & FormatNumber(Cells(15, 15), 4) & " with Tradebook on " & Range("trade_date") & "/bbr/br " & _ "ULTABLE border='1' width='230'TRTD width='140'" & _ Cells(12, 13) & "/TDTD align='right'" & FormatNumber(Cells(12, 15), 0) & _ "/TD/TRTRTD" & Cells(13, 13) & "/TDTD align='right'" & FormatNumber(Cells(13, 15), 0) & _ "/TD/TRTRTD/TDTD align='right'B" & FormatNumber(Cells(11, 15), 0) & "/B/TD/TR/TABLE/UL" & _ "brb Antonio J. SalcedobrNordkapp/b/br/BODY/HTML" .display Set objMail = Nothing Set objOL = Nothing End With ' Call update_inventory("T") Application.Calculation = xlCalculationAutomatic End Sub |
Not able to add default Signature
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 "Michael Bauer" wrote: 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 -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.vbOffice.net -- 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 = " Case "UN" to_recipient = " Case "UQ" to_recipient = " Case Else to_recipient = " 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 = "HTMLBODYB" & side & Range("currency") & " " & FormatNumber(Cells(15, 15), 4) & " with Tradebook on " & Range("trade_date") & "/bbr/br " & _ "ULTABLE border='1' width='230'TRTD width='140'" & _ Cells(12, 13) & "/TDTD align='right'" & FormatNumber(Cells(12, 15), 0) & _ "/TD/TRTRTD" & Cells(13, 13) & "/TDTD align='right'" & FormatNumber(Cells(13, 15), 0) & _ "/TD/TRTRTD/TDTD align='right'B" & FormatNumber(Cells(11, 15), 0) & "/B/TD/TR/TABLE/UL" & _ "brb Antonio J. SalcedobrNordkapp/b/br/BODY/HTML" .display Set objMail = Nothing Set objOL = Nothing End With ' Call update_inventory("T") Application.Calculation = xlCalculationAutomatic End Sub |
Not able to add default Signature
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. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.vbOffice.net -- 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 "Michael Bauer" wrote: 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 -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.vbOffice.net -- 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 = " Case "UN" to_recipient = " Case "UQ" to_recipient = " Case Else to_recipient = " 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 = "HTMLBODYB" & side & Range("currency") & " " & FormatNumber(Cells(15, 15), 4) & " with Tradebook on " & Range("trade_date") & "/bbr/br " & _ "ULTABLE border='1' width='230'TRTD width='140'" & _ Cells(12, 13) & "/TDTD align='right'" & FormatNumber(Cells(12, 15), 0) & _ "/TD/TRTRTD" & Cells(13, 13) & "/TDTD align='right'" & FormatNumber(Cells(13, 15), 0) & _ "/TD/TRTRTD/TDTD align='right'B" & FormatNumber(Cells(11, 15), 0) & "/B/TD/TR/TABLE/UL" & _ "brb Antonio J. SalcedobrNordkapp/b/br/BODY/HTML" .display Set objMail = Nothing Set objOL = Nothing End With ' Call update_inventory("T") Application.Calculation = xlCalculationAutomatic End Sub |
Not able to add default Signature
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 "Michael Bauer" wrote: 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. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.vbOffice.net -- 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 "Michael Bauer" wrote: 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 -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.vbOffice.net -- 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 = " Case "UN" to_recipient = " Case "UQ" to_recipient = " Case Else to_recipient = " 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 = "HTMLBODYB" & side & Range("currency") & " " & FormatNumber(Cells(15, 15), 4) & " with Tradebook on " & Range("trade_date") & "/bbr/br " & _ "ULTABLE border='1' width='230'TRTD width='140'" & _ Cells(12, 13) & "/TDTD align='right'" & FormatNumber(Cells(12, 15), 0) & _ "/TD/TRTRTD" & Cells(13, 13) & "/TDTD align='right'" & FormatNumber(Cells(13, 15), 0) & _ "/TD/TRTRTD/TDTD align='right'B" & FormatNumber(Cells(11, 15), 0) & "/B/TD/TR/TABLE/UL" & _ "brb Antonio J. SalcedobrNordkapp/b/br/BODY/HTML" .display Set objMail = Nothing Set objOL = Nothing End With ' Call update_inventory("T") Application.Calculation = xlCalculationAutomatic End Sub |
Not able to add default Signature
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? -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.vbOffice.net -- I have tried: With objMail .To = to_recipient .CC = "trade" .Subject = Range("name") & ", " & UCase(Range("ticker")) .BodyFormat = olFormatHTML .display Set objMail = Nothing Set objOL = Nothing End With but although I get the signature, I see no body text "Michael Bauer" wrote: 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. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.vbOffice.net -- 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 "Michael Bauer" wrote: 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 -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.vbOffice.net -- 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 = " Case "UN" to_recipient = " Case "UQ" to_recipient = " Case Else to_recipient = " 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 = "HTMLBODYB" & side & Range("currency") & " " & FormatNumber(Cells(15, 15), 4) & " with Tradebook on " & Range("trade_date") & "/bbr/br " & _ "ULTABLE border='1' width='230'TRTD width='140'" & _ Cells(12, 13) & "/TDTD align='right'" & FormatNumber(Cells(12, 15), 0) & _ "/TD/TRTRTD" & Cells(13, 13) & "/TDTD align='right'" & FormatNumber(Cells(13, 15), 0) & _ "/TD/TRTRTD/TDTD align='right'B" & FormatNumber(Cells(11, 15), 0) & "/B/TD/TR/TABLE/UL" & _ "brb Antonio J. SalcedobrNordkapp/b/br/BODY/HTML" .display Set objMail = Nothing Set objOL = Nothing End With ' Call update_inventory("T") Application.Calculation = xlCalculationAutomatic End Sub |
All times are GMT +1. The time now is 09:01 PM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com