![]() |
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
|
|||
|
|||
![]()
Hi all,
I made a custom task wich generate and send an e-mail (HTML), I used HTML.body I have 3 pb 1) How to add variable (some text) to the HTML body ? when I add something all the content of the Html is replaced by the text I added and the body switch to Text format.... 2) I added an image (logo) to the HTML mail but when the mail is received the place of the image is empty 3) I want to use different color in my Html mail but I fail to use more than one color , it always take the last color I used Tks fo help |
Ads |
#2
|
|||
|
|||
![]()
1) Show a code snippet to illustrate the problem. Remember that the content of HTMLBody must be fully tagged, consistent HTML code, just like in a web page.
2) See http://www.outlookcode.com/d/code/htmlimg.htm 3) Use font tags, just as you would in a web page. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "news.microsoft.com" wrote in message ... Hi all, I made a custom task wich generate and send an e-mail (HTML), I used HTML.body I have 3 pb 1) How to add variable (some text) to the HTML body ? when I add something all the content of the Html is replaced by the text I added and the body switch to Text format.... 2) I added an image (logo) to the HTML mail but when the mail is received the place of the image is empty 3) I want to use different color in my Html mail but I fail to use more than one color , it always take the last color I used Tks fo help |
#3
|
|||
|
|||
![]()
Hi Sue,
3) solved it'was easy tks sue 2) I'll take a look 1)here a part of the code sub SendAlertButton_click() ' THIS IS THE CONTENT OF THE BODY OF MY ' TASK THAT I WANT TO ADD TO THE CONTENT OF HTML MALI StrBB = item.body Set myItem = Application.CreateItem(0) StrHTML = "HTMLbiH1This is the Header of my mail/H1/i/bbrbrhrp align=""center"" img src=""\\MyComputer\myfolder\Images\MyImage.bmp"" /PhrbrbrbrpH2 style=""color:red""This some infomation about the content/H2bra /a/p brPscript type=text/vbscriptdocument.write(item.body)/script/P/HTML" 'HERE ARE THE DIFFERENT THINGS I TRYED StrHTML = StrHTML & "p" & strDetails & "/p" myitem.HTMLBody = StrHTML 'myitem.Body = StrHTML + StrBB myitem.htmlBody = myitem.htmlbody & "HTMLMMMMMMMMMMMMMMMMMMM/HTML" myitem.Display myitem.HTMLBody = StrHTML + StrBB End Sub ================================================== =============== "Sue Mosher [MVP-Outlook]" a écrit dans le message de news: ... 1) Show a code snippet to illustrate the problem. Remember that the content of HTMLBody must be fully tagged, consistent HTML code, just like in a web page. 2) See http://www.outlookcode.com/d/code/htmlimg.htm 3) Use font tags, just as you would in a web page. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "news.microsoft.com" wrote in message ... Hi all, I made a custom task wich generate and send an e-mail (HTML), I used HTML.body I have 3 pb 1) How to add variable (some text) to the HTML body ? when I add something all the content of the Html is replaced by the text I added and the body switch to Text format.... 2) I added an image (logo) to the HTML mail but when the mail is received the place of the image is empty 3) I want to use different color in my Html mail but I fail to use more than one color , it always take the last color I used Tks fo help |
#4
|
|||
|
|||
![]()
None of your efforts will work because none of them produce valid HTML. In other words, you missed the basic principle I expressed in my earlier message, "... the content HTMLBody must be fully tagged, consistent HTML code, just like in a web
page." You can see this problem if, for example, after these statements execute: myitem.HTMLBody = StrHTML StrHTML = StrHTML & "p" & strDetails & "/p" you look at the value of strHTML. Is it valid HTML? No, because it has a p tag after the closing /html tag. All of your other attempts suffer from the same problem (or worse, they try to insert script, which won't run in HTML messages). Instead of appending text to the existing HTML, you need to ***insert text inside*** the existing HTML content. There are two ways to do that with straightforward text parsing (no need to use the HTML Document itself). These techniques have nothing specific to do with Outlook or HTML, but are the same techniques you could use to turn "this text" into "this insert variable text text": 1) Parse the existing HTML into two sections -- the part before you want to insert your text and the part after -- then concatenate the three: part before & your HTML & part after 2) If you want to append, use the Replace() function to replace the ending /body/html tags with your text followed by /body/html. I find #2 to be by far the easier. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "news.microsoft.com" wrote in message ... 1)here a part of the code sub SendAlertButton_click() ' THIS IS THE CONTENT OF THE BODY OF MY ' TASK THAT I WANT TO ADD TO THE CONTENT OF HTML MALI StrBB = item.body Set myItem = Application.CreateItem(0) StrHTML = "HTMLbiH1This is the Header of my mail/H1/i/bbrbrhrp align=""center"" img src=""\\MyComputer\myfolder\Images\MyImage.bmp"" /PhrbrbrbrpH2 style=""color:red""This some infomation about the content/H2bra /a/p brPscript type=text/vbscriptdocument.write(item.body)/script/P/HTML" 'HERE ARE THE DIFFERENT THINGS I TRYED StrHTML = StrHTML & "p" & strDetails & "/p" myitem.HTMLBody = StrHTML 'myitem.Body = StrHTML + StrBB myitem.htmlBody = myitem.htmlbody & "HTMLMMMMMMMMMMMMMMMMMMM/HTML" myitem.Display myitem.HTMLBody = StrHTML + StrBB End Sub 1) How to add variable (some text) to the HTML body ? when I add something all the content of the Html is replaced by the text I added and the body switch to Text format.... |
#5
|
|||
|
|||
![]()
Ok Sue I understand my mistakes I follow your instruction and now it work
fine Now I have to undestand your example on how to insert my image Last thing How can I use the the HTML Format on a task body ?? "Sue Mosher [MVP-Outlook]" a écrit dans le message de news: ... None of your efforts will work because none of them produce valid HTML. In other words, you missed the basic principle I expressed in my earlier message, "... the content HTMLBody must be fully tagged, consistent HTML code, just like in a web page." You can see this problem if, for example, after these statements execute: myitem.HTMLBody = StrHTML StrHTML = StrHTML & "p" & strDetails & "/p" you look at the value of strHTML. Is it valid HTML? No, because it has a p tag after the closing /html tag. All of your other attempts suffer from the same problem (or worse, they try to insert script, which won't run in HTML messages). Instead of appending text to the existing HTML, you need to ***insert text inside*** the existing HTML content. There are two ways to do that with straightforward text parsing (no need to use the HTML Document itself). These techniques have nothing specific to do with Outlook or HTML, but are the same techniques you could use to turn "this text" into "this insert variable text text": 1) Parse the existing HTML into two sections -- the part before you want to insert your text and the part after -- then concatenate the three: part before & your HTML & part after 2) If you want to append, use the Replace() function to replace the ending /body/html tags with your text followed by /body/html. I find #2 to be by far the easier. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "news.microsoft.com" wrote in message ... 1)here a part of the code sub SendAlertButton_click() ' THIS IS THE CONTENT OF THE BODY OF MY ' TASK THAT I WANT TO ADD TO THE CONTENT OF HTML MALI StrBB = item.body Set myItem = Application.CreateItem(0) StrHTML = "HTMLbiH1This is the Header of my mail/H1/i/bbrbrhrp align=""center"" img src=""\\MyComputer\myfolder\Images\MyImage.bmp"" /PhrbrbrbrpH2 style=""color:red""This some infomation about the content/H2bra /a/p brPscript type=text/vbscriptdocument.write(item.body)/script/P/HTML" 'HERE ARE THE DIFFERENT THINGS I TRYED StrHTML = StrHTML & "p" & strDetails & "/p" myitem.HTMLBody = StrHTML 'myitem.Body = StrHTML + StrBB myitem.htmlBody = myitem.htmlbody & "HTMLMMMMMMMMMMMMMMMMMMM/HTML" myitem.Display myitem.HTMLBody = StrHTML + StrBB End Sub 1) How to add variable (some text) to the HTML body ? when I add something all the content of the Html is replaced by the text I added and the body switch to Text format.... |
#6
|
|||
|
|||
![]()
You don't. Task bodies are RTF, not HTML. See http://www.outlookcode.com/d/formatmsg.htm
-- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "bbnimda" wrote in message ... Last thing How can I use the the HTML Format on a task body ?? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Diplay HTML in junk e-mail - outlook 2003? | boe | Outlook - General Queries | 8 | October 28th 06 09:05 AM |
A bad draft HTML e-mail that crashes Outlook 2003. | Phillip Pi | Outlook - General Queries | 4 | September 26th 06 01:05 AM |
Eingebundene Bilder in Outlook-HTML-Mail / embedded graphics in HTML | Stefan Wirrer | Outlook - General Queries | 0 | August 23rd 06 02:26 PM |
FYI: Eingebundene Bilder in Outlook-HTML-Mail / embedded graphics in HTML | Stefan Wirrer | Outlook - General Queries | 1 | August 17th 06 03:25 PM |
FYI: Eingebundene Bilder in Outlook-HTML-Mail / embedded graphics in HTML | Stefan Wirrer | Outlook and VBA | 1 | August 17th 06 03:25 PM |