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

string variable that contains formatting



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 17th 06, 12:51 PM posted to microsoft.public.outlook.program_vba
Martin
external usenet poster
 
Posts: 87
Default string variable that contains formatting

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.
Ads
  #2  
Old January 17th 06, 04:51 PM posted to microsoft.public.outlook.program_vba
Jay Taplin
external usenet poster
 
Posts: 7
Default string variable that contains formatting

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


  #3  
Old January 17th 06, 04:58 PM posted to microsoft.public.outlook.program_vba
Jay Taplin
external usenet poster
 
Posts: 7
Default string variable that contains formatting

Sorry, my other post was for .NET... I was thinking I was still in the .NET
group!

Use the .TextRTF property.

Jay Taplin MCP


  #4  
Old January 17th 06, 09:59 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default string variable that contains formatting

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

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


"Martin" wrote:

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.

  #5  
Old January 19th 06, 10:49 AM posted to microsoft.public.outlook.program_vba
Martin
external usenet poster
 
Posts: 87
Default string variable that contains formatting

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

"Eric Legault [MVP - Outlook]" wrote:

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

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


"Martin" wrote:

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.

 




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
Formatting Signature Bill Helbron Outlook Express 17 April 24th 06 08:53 AM
Contacts not formatting with the ( ). John Outlook - Using Contacts 3 February 21st 06 05:02 AM
Outlook Application variable problem Ram Add-ins for Outlook 0 February 12th 06 03:25 PM
Formatting responses Jim Berglund Outlook - General Queries 1 February 12th 06 05:04 AM
Use Part of Subject as String CondtllyFrmttd Outlook - General Queries 0 January 23rd 06 07:57 PM


All times are GMT +1. The time now is 08:20 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.