Rich Text box  charachters

Posted on 1998-08-19
Last Modified: 2010-04-30
I have a rich text box control in my form and when it prints, or when I read text from it, I have a lot of rtf codes like /par and rtf1/ascii/../.... and so on. It goes on for about a mile. I realize this is due to it being a rtf box, but I know there is some way to eliminate these, I just can't remember. Any ideas?
Question by:Ciscokid
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1

Expert Comment

ID: 1429885
The rich text box .TextRTF property returns the text complete with RTF codes.  The .Text property returns it without them.  If this is not what you meant, please clarify.

Author Comment

ID: 1429886
No, not really. What I mean is - I have a rich text box. I read a normal text file into the rtb and it looks fine on the screen. However, when I do any file/string reads or anything of the sort, incluging printing. It prints the rtf characters also.

For example: Let's say you have a rtb with one word in it - "word". If you read the line in and do say a debug.print rtbText1 or print it, it will give you /rtf1/par/}fjdaskfl;djfkdfjkajdkfl;dskfjdskl;/arp / rgj / par/ "word". Or something like that. Basically, all the header info and Paragraph control characters of the rt box.


Expert Comment

ID: 1429887
So instead try "debug.print rtbtext1.Text" because otherwise it appears to be assuming debug.print rtbtext1.TextRTF
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 1429888
It doesn't matter which one you do. Debug.print doesn't really matter. Let's say you just print the file, or read the characters, it reads the rtext characters.

Accepted Solution

Chamberlain earned 50 total points
ID: 1429889
If you have an RTF file (That has all the RTF codes) and you want to strip them out, put it into a RTB via the TextRTF property and read it back from the Text property.  The control will strip out all the junk for you.  

Expert Comment

ID: 1429890
You have to load an rtf file with open and then use the textRTF property.

Expert Comment

ID: 1429891
The method you refer to is LoadFile (Not Open).  You Don't HAVE to use it.  You CAN. You also can just open the file via some other means and assign the contents to the TextRTF property.

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question