I have this web application in C # .net running on an external web server. In this, I am trying to create and save the word doc on the server (without opening it). It runs fines on my local computer, since I have a word installed on my machine, but on the server it shows an error when using the MyApplication class. I understand that it is impossible to set the word on the server. Right now I'm referencing the word.interopp assembly in my application. Is there a better way to solve the problem.
Thank you and welcome
Vicki J.
If you try to use Office Interop without installing an office on the server, then it obviously will not work.
Word - - ?
, , Word, .
? ? RTF?
Aspose.Word. Word Word .
word.interop . , , WINWORD . , , , word.interop. , , Word 2007, , Word. , :)
, - . .
protected void btnCreateWordBulletin_Click(object sender, EventArgs e) { String a= Server.MapPath("/Solution/Templates/Sport/Sport.doc"); String b= Server.MapPath("/Solution/Templates/Sport/SportSave.doc"); CreateWordDocument(a, b); } protected void CreateWordDocument(object fileName, object saveAs) { //Set Missing Value parameter - used to represent //a missing value when calling methods through interop object missing = System.Reflection.Missing.Value; //Setup the Word.App class Microsoft.Office.Interop.Word.Application WordApp = new Microsoft.Office.Interop.Word.ApplicationClass(); Microsoft.Office.Interop.Word.Document aDoc = null; // Check to see that file exists if (System.IO.File.Exists((string)fileName)) {... Activating doc etc...}}
, Word . , winword.exe -, , winword.exe ASPNET. MS , Word . , ASPNET " ", ASPNET, Word , , ASPNET . winword (: , ), .
: winword . , MS , . winword ... .
OfficeWriter - , DOC DOCX ( RTF ):
http://www.officewriter.com
OpenXML, . ( Office) . http://openxmldeveloper.org/
Source: https://habr.com/ru/post/1714955/More articles:Control the back of the "button" in android - androiddependency browser that works against inversion of the control structure - dependency-injectionIs it possible to create an attribute that can only be set in the constructor in Moose? - perlSparse multidimensional data representation - cPatterns / Practice for Encapsulating Predicates - c #DB2, how to send an email from a stored procedure? - emailStored Proc in RIA Services - sqlSQL Server Indexed View syntax for a federated database - sql-serverCentering Dialog Using JOptionPane.showMessageDialog - javaHow to fix empty PHP_Beautifier strings? - phpAll Articles