Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rich Text Box/RTF file discrepancy

Status
Not open for further replies.

trollacious

Programmer
Sep 29, 2004
4,046
US
Using the Rich Text Box control, I display a RTF formatted string put together by the program. I designed the RTF form outside the program (saved in WordPad to avoid MS Word RTF codes), then copied the RTF codes directly from a text editor into the program to plug in the desired data, with vbCrLf new lines in the appropriate spots. The format in the RTF control doesn't look the same on the screen as the file that's written with the exact same string.

The character string is generated once by the function, then put into the RTFbox.TextRTF and the file on the computer. The output file opens fine in WordPad and MS Word 2000, and looks exactly like I want, even though the RTF box loses some of the table formatting. The only character I couldn't seem to add to the RTF string was ASCII 0, but that's understandable since VB strings are ASCII 0 terminated, too. I don't think that's the problem, though, since the file on the hard drive displays fine in both Word and WordPad.

Any ideas what might be causing the problem, and how to fix it?

Lee
 
Just checked, and loading a RTF file with a table in it into a Rich Text Box control that was created in MS Word 2000 and saved with WordPad shows the same problems as the one created by the VB program. The RTF file looks fine in Word and WordPad.

Lee
 
Probably worth pointing out that the RTB control is actually rather limited in capability
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top