We need to open a word document which is located on a server on the clients machine using Microsoft Word. The solution is working locally however when deployed on server then only thing that happens is that the winword.exe is started on the server. Is this possible to do using interop or javascript?
this is the code till now
Microsoft.Office.Interop.Word.ApplicationClass wordApp = new Microsoft.Office.Interop.Word.ApplicationClass();
object file = FilePath + FileName;
lblError.Text = lblError.Text + file.ToString();
object readOnly = false;
object objTrue = true;
object missing = System.Reflection.Missing.Value;
object emptyData = string.Empty;
wordApp.Visible = true;
Microsoft.Office.Interop.Word.Document aDoc =
wordApp.Documents.Open(ref file,
ref missing, ref readOnly,
ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing,
ref missing, ref missing, ref objTrue);
aDoc.Activate();
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…