Windows Develop Bookmark and Share   
 index > Windows Forms General > RichTextBox not displaying Word rtf file properly
 

RichTextBox not displaying Word rtf file properly

Hello all,

I have a browse button which allows users to select a Word rtfdocument. I then loadthe selected fileinto a RichTextBox control using the following code:

Code Block

With New IO.StreamReader(UserSelectedFileNameAndPath)
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 textand 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!

j2associates  Wednesday, October 17, 2007 2:02 PM
The native Rich Text editor control used by RTB doesn't have good support for Word tables. There is a newer version of that control available on XP SP1 and later. Check this thread for code that shows you how to use it. Before you try it, check if Wordpad can show the tables correctly.
nobugz  Wednesday, October 17, 2007 3:05 PM
The native Rich Text editor control used by RTB doesn't have good support for Word tables. There is a newer version of that control available on XP SP1 and later. Check this thread for code that shows you how to use it. Before you try it, check if Wordpad can show the tables correctly.
nobugz  Wednesday, October 17, 2007 3:05 PM
Thanks nubugz, very helpful link!

j2associates  Wednesday, October 17, 2007 9:42 PM

You can use google to search for other answers

Custom Search

More Threads

• Combo Boxes
• binding a combobox to a sortedlist then reading the selected value (not the text)
• Need Help to show Rich Editable text box and Datagrid in a tab or form, new to Visual C++ 2003
• move controller from a cell to another in table layout panle in C#
• simulate helpbutton behaviour
• API calls
• AccessViolationException when trying to change IsBalloon in a Tooltip popup event
• Throttling a Windows Form Application
• How to create a control similar to that of option dialogs in windows
• User Control constructors