Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How to open the word document into richtextbox .The word document contians text and images ......

Can any one provide solution for this ...

Thanks
Vijay
Posted
Comments
[no name] 29-Aug-12 8:09am    
RichTextBox can only receive text value not Images.
Dave Kreskowiak 29-Aug-12 8:19am    
Not true. The RTB can handle images if done correctly.

The RichTextBox doesn't know how to handle the Word document format, so you don't open it in a RichTextBox.

Now if your Word document was saved in RTF or Text format, that'll work, but you'll lose at least some document formatting and some editing support depending on what's in the document.
 
Share this answer
 
Comments
Vijay Selvaraj 29-Aug-12 8:20am    
Thanks it's Working
Hello,

Although this has already been said, Rich Text box Controls can only load RTF formats, not doc files. But if you save your word document as "Word 97-2003 & 6.0/95-RTF" it will save the file as an rtf file with a doc extension. You can open that word document using the following statement.

richTextBox1.LoadFile(@"C:\Users\VINOD\Desktop\CodeProject\GridviewColumMErging.doc",
RichTextBoxStreamType.RichText);

Thanks!!!
 
Share this answer
 
Comments
Praveen Kullu 30-Aug-12 2:06am    
wow didn't know that!!
This article on CodeProject can help you:
Summarize C# Control Word Skills[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900