i want to open word file click on button, only for copy some text on doc file.i have do following code but it opens on browser and it can't show proper way.that's why i thing open only word file on Microsoft word doc,it is the best way,because my use is open doc file for copy some text nothing else.
What I have tried:
string executableLocation = Path.GetDirectoryName(
Assembly.GetExecutingAssembly().Location);
string xslLocation = Path.Combine(executableLocation, "hemtech changes.docx");
Application ap = new Application();
Document doc = ap.Documents.Open(xslLocation, ReadOnly: false);
Microsoft.Office.Interop.Word.Application objWordApp = new Microsoft.Office.Interop.Word.Application();
object objWordFile = "D:\\hemtechchanges.docx";
object objNull = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Word.Document WordDoc = objWordApp.Documents.Open(
ref objWordFile, ref objNull, ref objNull,
ref objNull, ref objNull, ref objNull,
ref objNull, ref objNull, ref objNull,
ref objNull, ref objNull, ref objNull, ref objNull, ref objNull, ref objNull, ref objNull);
WordDoc.ActiveWindow.Selection.WholeStory();
WordDoc.ActiveWindow.Selection.Copy();
string strWordText = WordDoc.Content.Text;
WordDoc.Close(ref objNull, ref objNull, ref objNull);
objWordApp.Quit(ref objNull, ref objNull, ref objNull);
Response.Write(strWordText);