Hi T.saravanan . .
your code is working fine .. but after one change .
in this line you enter 12 parameters . . but in asp.net want 16 parameters
Microsoft.Office.Interop.Word.Document doc = wordApp.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);
my ruining code in asp.net
ApplicationClass wordApp = new ApplicationClass();
object file = path;
object nullobj = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Word.Document doc = wordApp.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);
doc.ActiveWindow.Selection.WholeStory();
doc.ActiveWindow.Selection.Copy();
string sFileText = doc.Content.Text;
doc.Close(ref nullobj, ref nullobj, ref nullobj);
wordApp.Quit(ref nullobj, ref nullobj, ref nullobj);
Response.Write(sFileText);
Best Regard's
Prabhakar
Karthikanbarasan, if this helps please login to Mark As Answer. | Alert Moderator