J
Jay
Hi,
I need to read word document file in ASP.net and place it in a text
box .
How to do it ? i tried :
Word.Application app = new Word.ApplicationClass();
object nullobj = System.Reflection.Missing.Value;
object file = @"C:\Suneetha\Ques.doc";
Word.Document doc = app.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);
doc.ActiveWindow.Selection.WholeStory();
doc.ActiveWindow.Selection.Copy();
IDataObject data = Clipboard.GetDataObject();
string text = data.GetData(DataFormats.Text).ToString();
Console.WriteLine(text);
doc.Close(ref nullobj, ref nullobj, ref nullobj);
app.Quit(ref nullobj, ref nullobj, ref nullobj);
but i got few error :
" No overload for method 'Open' takes '15' arguments "
is there any toehr way to read a word document file ?
waiting for ur replay ,
Thanks,
Jay
I need to read word document file in ASP.net and place it in a text
box .
How to do it ? i tried :
Word.Application app = new Word.ApplicationClass();
object nullobj = System.Reflection.Missing.Value;
object file = @"C:\Suneetha\Ques.doc";
Word.Document doc = app.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);
doc.ActiveWindow.Selection.WholeStory();
doc.ActiveWindow.Selection.Copy();
IDataObject data = Clipboard.GetDataObject();
string text = data.GetData(DataFormats.Text).ToString();
Console.WriteLine(text);
doc.Close(ref nullobj, ref nullobj, ref nullobj);
app.Quit(ref nullobj, ref nullobj, ref nullobj);
but i got few error :
" No overload for method 'Open' takes '15' arguments "
is there any toehr way to read a word document file ?
waiting for ur replay ,
Thanks,
Jay