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 - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Rich Text Loses formatting on VBScript Replace



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 20th 06, 11:46 AM posted to microsoft.public.outlook.program_forms
[email protected]
external usenet poster
 
Posts: 5
Default Rich Text Loses formatting on VBScript Replace

I have an outlook form in which I have a small amount of code behind,
simply to change a hyperlink to encorperate then value entered in a
compulsary custom field. The code is as follows:

Function Item_Send()
Item.Body = Replace(Item.Body, "@@@@@",
Item.UserProperties.Find("jobNumber").Value)
End Function

The function works, however the message (in Rich Text format) loses all
formatting. Is there any way I can keep the forms current layout?

Many Thanks in Advance!

Ben.

  #2  
Old April 20th 06, 12:31 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Rich Text Loses formatting on VBScript Replace

That's normal, expected behavior. You have jump through quite a few hoops if you want to preserve RTF formatting; 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

wrote in message oups.com...
I have an outlook form in which I have a small amount of code behind,
simply to change a hyperlink to encorperate then value entered in a
compulsary custom field. The code is as follows:

Function Item_Send()
Item.Body = Replace(Item.Body, "@@@@@",
Item.UserProperties.Find("jobNumber").Value)
End Function

The function works, however the message (in Rich Text format) loses all
formatting. Is there any way I can keep the forms current layout?

Many Thanks in Advance!

Ben.

  #3  
Old April 20th 06, 02:58 PM posted to microsoft.public.outlook.program_forms
[email protected]
external usenet poster
 
Posts: 5
Default Rich Text Loses formatting on VBScript Replace

Thanks very much!

The code you posted on
http://www.outlookcode.com/codedetail.aspx?id=455 was perfect! did
exactly what I wanted with very slight modification!

Thanks again

Ben.

 




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
Rich text - HTML Orcas2369 Outlook - Using Contacts 1 April 11th 06 05:56 PM
Rich Text Formatting WM Outlook - Using Forms 6 April 3rd 06 02:56 PM
How do I read all my received mails in html- or rich text? New to MS outlook Outlook - General Queries 1 March 27th 06 10:43 AM
Copying to a text field in Contacts loses formatting Jaime Outlook - Using Contacts 1 March 9th 06 11:23 PM
Message sent as Rich Text appear as HTML fali Outlook - General Queries 1 March 2nd 06 09:46 PM


All times are GMT +1. The time now is 11:18 AM.


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.