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!

RichTextBox not displaying Word rtf file properly

Status
Not open for further replies.

SBendBuckeye

Programmer
May 22, 2002
2,166
US
Hello all,

I have a browse button which allows users to select a Word document. I then load it into a RichTextBox control using the following code:
Code:
With New IO.StreamReader(Me.txtInputFile.Text.Trim)
    Me.RichTextBox1.Rtf = .ReadToEnd
    .Close()
    .Dispose()
End With
The problem is that the Word tables are not displayed correctly. It appears that column widths are calculated incorrectly so that header and data ends up being displayed to the right of the table rectangles.

How can I fix this? Thanks in advance for any ideas and/or suggestions!


 
I know it's no help (or comfort I imagine) but the same behaviour is displayed if you use the RichTextBoxes native LoadFile method:
Code:
RichTextBox1.LoadFile(Me.txtInputFile.Text.Trim, RichTextBoxStreamType.RichText)
Cheers

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top