I am using C# ASP.NET and I need to be able to open a .Docx file that is located on the server on the client, I was thinking that this could be done with a memory stream or simply just directing Word to the server URL. Saldy I have not gotten anything to work, the code snippet below is my current attempt at resolving the issue.
void ReadDocument(String fileName)
{
// setup the path to the file.
object template = Server.MapPath("~\\Assets\\" + fileName.Trim());
Microsoft.Office.Interop.Word.Application wordObject = new Microsoft.Office.Interop.Word.Application();
object nullobject = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Word.Document outDocument = wordObject.Documents.Open
(ref template, ref nullobject, ref nullobject, ref nullobject,
ref nullobject, ref nullobject, ref nullobject, ref nullobject,
ref nullobject, ref nullobject, ref nullobject, ref nullobject,
ref nullobject, ref nullobject, ref nullobject, ref nullobject);
outdocument.Activate();
processReport(wordObject);
//return outDocument;
}

New Topic/Question
Reply



MultiQuote






|