reading doc file in textbox using .net2005 with c#

Answer Posted / anand

ApplicationClass WordOper = new ApplicationClass();
String filePath = Server.MapPath("../Files/Book.doc");
Object file = filePath;
object nullobj = System.Reflection.Missing.Value;
Document doc = WordOper.Documents.Open(ref file, ref
nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj, ref nullobj);
Document doc1 = WordOper.ActiveDocument;
string m_Content = doc1.Content.Text;
TextBox1.Text = m_Content;
doc.Close(ref nullobj, ref nullobj, ref nullobj);

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What operating systems will the .net framework 3.0 be available for?

782


How do you assign a value to a complex number 7 how has exception hand changed in .net framework 4.0?

710


mention what is the difference between ado.net and classic ado?

766


What are html helpers in asp.net mvc?

770


Explain Sections is ASP.Net MVC?

791


how do you mark a property as required? For example, for a project, the name is a required field.

794


What is the .net framework?

763


Difference between ASP.NET MVC and ASP.NET WebForms?

784


What are child actions in ASP.Net MVC?

773


Can I set the unlimited length for "maxjsonlength" property in config?

762


What does a viewmodel do?

722


How can we determine action invoked from HTTP GET or HTTP POST?

766


What is the use of action filters in an mvc application?

845


What are the new features 3.5 framework against with the tool?

757


Is entity framework slow?

737