Rajesh batchu

in my rich text box control i need to keep ms document file

can any one help me




Re: Windows Forms Data Controls and Databinding i need to keep the content of a .doc file in my rich text box control

Andrej Tozon

Hi,

I'm afraid you can't really load a .doc file into a RTB control directly. However, you can save a Word document to a RTF formatted file (Save As... Rich Text Format) and load that into the RTB:

richTextBox1.LoadFile("c:\\myfile.rtf");

... or you could copy the contents form the Word application (Select All | Copy) to the RTB control and save that:

richTextBox1.SaveFile("c:\\myfile.rtf");

(to load this document again, use the first statement).

Andrej






Re: Windows Forms Data Controls and Databinding i need to keep the content of a .doc file in my rich text box control

Rajesh batchu

can any one help me out i am also in the same problem




Re: Windows Forms Data Controls and Databinding i need to keep the content of a .doc file in my rich text box control

Ken Tucker

The richtextbox does not support word documents try showing it in a web browser control instead.


WebBrowser1.Navigate("C:\datagridview faq.doc")







Re: Windows Forms Data Controls and Databinding i need to keep the content of a .doc file in my rich text box control

Rajesh batchu

webbrowser1.navigate("filename")

this is working fine for office 2003

but

this is not working for msword2007

when i try to open the word document it is opening in a saperate ms word interface

but i need to open in the web browser control

can any one solve this






Re: Windows Forms Data Controls and Databinding i need to keep the content of a .doc file in my rich text box control