• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 239
  • Last Modified:

Rich Text box charachters

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?
0
Ciscokid
Asked:
Ciscokid
  • 2
  • 2
  • 2
  • +1
1 Solution
 
AlexVCommented:
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.
0
 
CiscokidAuthor Commented:
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.

0
 
AlexVCommented:
So instead try "debug.print rtbtext1.Text" because otherwise it appears to be assuming debug.print rtbtext1.TextRTF
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
CiscokidAuthor Commented:
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.
0
 
ChamberlainCommented:
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.  
0
 
ewweigCommented:
You have to load an rtf file with open and then use the textRTF property.
0
 
ChamberlainCommented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now