![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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 |
Ads |
#2
|
|||
|
|||
![]()
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 |
#3
|
|||
|
|||
![]()
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 |
#4
|
|||
|
|||
![]()
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 |
#5
|
|||
|
|||
![]()
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 |
#6
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to add signature in a single mail? | anders bitzer | Outlook - General Queries | 1 | April 10th 06 10:31 AM |
setting signature as default | drmeh | Outlook and VBA | 0 | March 6th 06 01:59 AM |
Can I add a default Subject to my signature file? | Aaron_I | Outlook - Using Forms | 0 | February 23rd 06 01:11 AM |
Can I add a default Subject to my signature file? | Aaron_I | Outlook - Installation | 0 | February 22nd 06 08:36 PM |
Add signature to calendar meeting request | markj | Outlook - Calandaring | 11 | February 12th 06 11:33 PM |