I am getting to much mails for this problems answer so i am pasting this solution here only,,,
Only problem to this code is that ..it dosent preserves the formatting for the doc files, if any one finds that plz do reply.
Thanks,
Good Luck....
All before add reference of COM object >>>> Microsoft Word 10.0 Object Library
this is the code....>>
using System.Runtime.InteropServices;
using Word;
private void Button3_ServerClick(object sender, System.EventArgs e)
{
Word.Application obj_app=new ApplicationClass();
Word.Document obj_doc=new DocumentClass();
object readOnly = false;
object isVisible = true;
object missing = System.Reflection.Missing.Value;
object filepath=(@"c:\Resume.doc"); //file to be read
obj_doc=obj_app.Documents.Open(ref filepath,
ref missing,ref readOnly,
ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing,
ref missing, ref missing, ref isVisible,
ref missing,ref missing,ref missing);
obj_doc.Select();
Response.Write(obj_app.Selection.FormattedText.Tex t);
obj_doc.Close(ref missing,ref missing,ref missing);
obj_app.Quit(ref missing, ref missing, ref missing);
}
|