Hi
i am working on to open a word file in popup windows and i am able to open whne i am running using visual studio but the problem is that after configuring into IIS if i am trying to open same word file from path it's throwing error that
"This command is not available because no document is open."
below is my code.
Microsoft.Office.Interop.Word.Document docs;
Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.ApplicationClass();
docs = null;
object miss = System.Reflection.Missing.Value;
// create object of selected file path
object path = @"F:\Temp1\" + "Test.doc";
// set file path mode
object readOnly = false;
ApplicationClass applicationclass = new ApplicationClass();
docs = word.Documents.Open(ref path, ref miss, ref readOnly, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss);
applicationclass.Visible = false;
Document document = word.ActiveDocument;
Note: docs variable is returning NULL means open command is not working to open the file.