A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

build a string from HTML to modify template



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 13th 06, 03:25 PM posted to microsoft.public.outlook.program_vba
Bob
external usenet poster
 
Posts: 10
Default build a string from HTML to modify template

I need to be able to automatically send a HTML template in response to
a rule in Outlook 2003.

It seems that for me to do this I need to be able to make a string from
an existing HTML template,
insert a string with the customer's name in the proper section of the
HTML string, then insert the entire string back into the template as
objItem.HTMLBody = strHTML.

Problem is I don't know how to build a string from HTML.

Can anyone offer any suggestions or point me in a direction where I can
find some examples on converting HTML code into a string. I need to
preserve all formatting and hyperlinks.

Thank you in advance for your assistance!

Bob

Ads
  #2  
Old December 15th 06, 02:37 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default build a string from HTML to modify template

You don't need to know any HTML for that task. Create an .oft file with placeholder text where you want the name to appear. I use tokens like %name%. Then load the template and use Replace():

Set itm = Application.CreateItemFromTemplate("C:\myfile.oft" )
itm.HTMLBody = Replace(itm.HTMLBody, "%name%", _
"customer_name")
etc.

--
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

"Bob" wrote in message oups.com...
I need to be able to automatically send a HTML template in response to
a rule in Outlook 2003.

It seems that for me to do this I need to be able to make a string from
an existing HTML template,
insert a string with the customer's name in the proper section of the
HTML string, then insert the entire string back into the template as
objItem.HTMLBody = strHTML.

Problem is I don't know how to build a string from HTML.

Can anyone offer any suggestions or point me in a direction where I can
find some examples on converting HTML code into a string. I need to
preserve all formatting and hyperlinks.

Thank you in advance for your assistance!

Bob

  #3  
Old December 15th 06, 08:34 PM posted to microsoft.public.outlook.program_vba
Bob
external usenet poster
 
Posts: 10
Default build a string from HTML to modify template

Thank you for taking the time to explain.

Regards,

Bob
Sue Mosher [MVP-Outlook] wrote:
You don't need to know any HTML for that task. Create an .oft file with placeholder text where you want the name to appear. I use tokens like %name%. Then load the template and use Replace():

Set itm = Application.CreateItemFromTemplate("C:\myfile.oft" )
itm.HTMLBody = Replace(itm.HTMLBody, "%name%", _
"customer_name")
etc.

--
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

"Bob" wrote in message oups.com...
I need to be able to automatically send a HTML template in response to
a rule in Outlook 2003.

It seems that for me to do this I need to be able to make a string from
an existing HTML template,
insert a string with the customer's name in the proper section of the
HTML string, then insert the entire string back into the template as
objItem.HTMLBody = strHTML.

Problem is I don't know how to build a string from HTML.

Can anyone offer any suggestions or point me in a direction where I can
find some examples on converting HTML code into a string. I need to
preserve all formatting and hyperlinks.

Thank you in advance for your assistance!

Bob


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Embedding html and text files in an email template. Maria Outlook - General Queries 0 October 31st 06 11:32 PM
.NET means to build a Transport Provider Christian Jensen Add-ins for Outlook 1 August 2nd 06 03:34 PM
Unable to build custom fields DougEvans Outlook - Using Forms 10 June 23rd 06 05:47 PM
OE mail template "new" and "replay" modify maziek Outlook - General Queries 2 April 18th 06 08:21 PM
will outlook build contact info with inbox? A Alexander Outlook - Using Contacts 3 February 22nd 06 10:19 PM


All times are GMT +1. The time now is 08:50 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-2025 Outlook Banter.
The comments are property of their posters.