Today, I saw the carloads provided by the website recommended by the inspiration source. excelxmlwriter, I think it is good. I have a look at the decompilation. In fact, I am constructing an XML document and then using writer1.writeprocessinginstruction ("MSO-application", "progid = 'excel. sheet '"); To set to open in Excel, so we can easily obtain an Excel. Obviously, this method does not require the server to install Excel.
I suddenly thought that I could generate a word in the same way. The answer is yes. This blog pointed out the method:
Http://weblogs.asp.net/cnagel/archive/2004/09/25/234188.aspx
Make a simple example. Copy the following xmlto notepad, save it as test.doc, and open it.
<? XML version = "1.0" encoding = "UTF-8"?>
<? MSO-application progid = "word. Document"?>
<W: worddocument xmlns: W = "http://schemas.microsoft.com/office/word/2003/wordml">
<W: Body>
<W: P>
<W: r>
<W: T> the MS-2524, XML Web Services programming </W: T>
</W: r>
</W: P>
<W: P>
<W: r>
<W: T> MS-2124, C # programming </W: T>
</W: r>
</W: P>
<W: P>
<W: r>
<W: T> net2,. NET 2.0 early adapter </W: T>
</W: r>
</W: P>
</W: Body>
</W: worddocument>
So why can't we use the same principle of carlow.excelxmlwriter to provide a class library that generates word without installing word?
However, it should be noted that I have not tested whether earlier versions of word support me. I am using Office 2003. Office 2003 XML reference schemas can be downloaded:
Http://www.microsoft.com/downloads/details.aspx? Familyid = fe118952-3547-420a-a412-00a2662442d9 & displaylang = en
In addition, the source of inspiration once provided a smartexcel class library, you can also generate an excel without installing excel, but the principle is similar to carloader. different from excelxmlwriter, excelxmlwriter should directly write files in Excel format.