Displaying word documet in Windows Application
How can i display word document in windows application?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
TulasiPosted Sep 26, 2011, 8:30 AM
see i have listbox in that i display .txt files and doc files, when i double click on the listitem (xxx.txt file) it has to open the xxx.txt file so user can see the content of xxx.txt file(it should be readonly mode) , if he want he can download it , otherwise he click on cancel button
Prabhu RajaPosted Sep 26, 2011, 2:55 AM
---------------------------------------------------------------------
If this post helps you, than mark as "Correct Answer"
Thank you
Prabhu Raja
TulasiPosted Sep 26, 2011, 2:30 AM
Prabhu RajaPosted Sep 26, 2011, 1:30 AM
WebBrowser1.Navigate(@"C:\doc\MyDoc.txt")
------------------------------------------------------------
If this post helps you, then mark as "Correct Answer"
Thank You
TulasiPosted Sep 26, 2011, 1:12 AM
sry for the late replay, i dont want to open ,read ,edit and close . just i want to display .txt file (without reading its content) . like word (above)
Prabhu RajaPosted Sep 24, 2011, 1:19 AM
Prabhu RajaPosted Sep 22, 2011, 8:17 AM
//insert namespace
using System.IO;
StreamReader objstream = new StreamReader("D:\\1.txt"); //txt file Path
label2.Text = objstream.ReadToEnd();
TulasiPosted Sep 22, 2011, 7:19 AM
Prabhu RajaPosted Sep 22, 2011, 7:12 AM
webBrowser1.Url = new Uri(@"C:\doc\MyDoc.txt");
----------------------------------------------------------------------
If it helpful, then mark as "Correct Answer"
Thank You
TulasiPosted Sep 22, 2011, 6:10 AM
code, which you have sent me is working , if i want to dispaly .txt type files ?
Prabhu RajaPosted Sep 22, 2011, 5:54 AM
1) Add a WebBrowser Control in Your Windows Form,
2) Make your Web Browser Control to point a Word file By,
webBrowser1.Url = new Uri(@"C:\doc\MyDoc.doc");
// add above code Where you want, for example , inside of form_Load() event or Button_CLick() event.
3) Make Sure You must have Internet Explorer and MS Word on Your System.
-----------------------------------------------------------------------
If this helps you, then mark as "Correct Answer"
Thank You