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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RTF Files with tables do not format correctly

Status
Not open for further replies.

VicSpainhower

Programmer
Sep 9, 2000
5
US
This was posted in the vb.net forum mistakenly.

I have a vb6 program that reads an rtf file into a RichTextBox. The rtf file is simply a word table. The problem is that it ignores the boundries of the column and wraps the text either onto the next line (starting in col1 for the last col) or the text will just format into the adjacent column. I have been searching all day so I'm hoping someone has a solution for this.

Thanks,

Vic
 
Perhaps someone can piece together what you mean, but it looks to me that you're assuming too much background knowledge on our part.

An interesting technique in explaining a problem is to look for every instance of the word "the", and see if whatever noun it applies to can be assumed to be within the scope of VB6 praxis or whether it's specific to your problem domain. If the latter, it needs to be explained. Perhaps you can revisit this, explaining your intent with boundaries and columns to give more context.
 
Bob,

I'm not sure why it's not clear but it's easy to create as follows:

1. Create a VB6 project
2. Create a form
3. Add a RichTextBox to the Form
4. modify the filename property to point to the rtf file that you can download here using the link below.
5. run the program

It's pretty obvious what is happening because the text in the table does not stay in their prospective columns.

Vic
 
 http://www.perfected.com/table1.rtf
Ok, I see what's wrong. The problem is that the version of Rich Text supported by the VB Rich Textbox control (1.0) doesn't support table formatting at all. I tried adapting strongm's brilliancy from here thread222-1383606, but it doesn't work either. So, I did a bit of research. Versions before 3.0 don't support tables at all. Version 3.0 clearly states that while it has basic table support it doesn't support wrapping text in cells. The other versions are 4.1 and 6.0. One of these versions supports it, because when I open your file in WordPad, it looks fine, and WordPad must use one of these versions.

Strongm is the real expert on this; perhaps he will chime in. I think it might be possible to do this using TOM but it looks like a real headache.

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top