Rich Text Loses formatting on VBScript Replace

  • Thread starter Thread starter ben.agnoli
  • Start date Start date
B

ben.agnoli

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

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top