Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / January 2006

Tip: Looking for answers? Try searching our database.

string variable that contains formatting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Martin - 17 Jan 2006 11:51 GMT
Using RTF as editor, can I assign the typed and formatted text of the body of
a message to a variable that remembers the formatting?  I want to be able to
automatically truncate a signature and replace it with a different one - fine
with the usual string functions but all of them strip out any formatting the
user has included.
Jay Taplin - 17 Jan 2006 15:51 GMT
You should be able to assign the RTF property to a string variable, such as:

   strRTF = RichTextBox1.RTF

To parse the text and replace the signature you'll need to understand the
RTF codes...

Jay Taplin MCP
Jay Taplin - 17 Jan 2006 15:58 GMT
Sorry, my other post was for .NET... I was thinking I was still in the .NET
group!

Use the .TextRTF property.

Jay Taplin MCP
Eric Legault [MVP - Outlook] - 17 Jan 2006 20:59 GMT
You can use CDO with a special .dll to read and write RTF with a little
difficulty.  An easier option is to use Word as your e-mail editor and use
the Word Object Model to set and read rich text formatting:

How to create formatted messages in Microsoft Outlook:
http://www.outlookcode.com/d/formatmsg.htm#wordmail

Signature

Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/

> Using RTF as editor, can I assign the typed and formatted text of the body of
> a message to a variable that remembers the formatting?  I want to be able to
> automatically truncate a signature and replace it with a different one - fine
> with the usual string functions but all of them strip out any formatting the
> user has included.
Martin - 19 Jan 2006 09:49 GMT
That looks possible Eric - I've been looking at some of Sue Mosher's
published code and that may do the trick.  Is there any way in VBA to switch
editors as I see the EditorType property is read-only?  And I guess I could
have problems as my company has switched off the option to use Word as editor
(by way of a group policy).

> You can use CDO with a special .dll to read and write RTF with a little
> difficulty.  An easier option is to use Word as your e-mail editor and use
[quoted text clipped - 8 lines]
> > with the usual string functions but all of them strip out any formatting the
> > user has included.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.