Solved

Rich Text box  charachters

Posted on 1998-08-19
7
226 Views
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?
0
Comment
Question by:Ciscokid
  • 2
  • 2
  • 2
  • +1
7 Comments
 

Expert Comment

by:AlexV
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.
0
 

Author Comment

by:Ciscokid
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.

0
 

Expert Comment

by:AlexV
ID: 1429887
So instead try "debug.print rtbtext1.Text" because otherwise it appears to be assuming debug.print rtbtext1.TextRTF
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:Ciscokid
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.
0
 
LVL 1

Accepted Solution

by:
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.  
0
 

Expert Comment

by:ewweig
ID: 1429890
You have to load an rtf file with open and then use the textRTF property.
0
 
LVL 1

Expert Comment

by:Chamberlain
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.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now