June 28, 2006Code to create Office XMLPosted 1492 days ago on June 28, 2006How do you generate Office XML (the Microsoft variant) in code? Doug Mahugh has posted an example. There are two parts to it, first generating the XML, then packaging it into a ZIP archive using the .NET Packaging API. What if the Packaging API is not available, maybe because you are not using .NET? Rob Baduel has another example which avoids the Packaging API; it is still C#, but you could easily port it to Java or some other language, running on Windows or elsewhere. It makes huge sense to generate XML rather than something like RTF, and to use an XML library rather than automating Word or Excel - provided that your target users can actually make use of the documents. Unfortunately that is a major proviso. If an application needs to write formatted text to the Windows clipboard, RTF is still pretty much unavoidable, and that won't change for a long while. If you don't know what application the user might use to open your document, RTF is the safest choice. Still, as part of the long haul towards XML, this is progress. No comments, be the first! |
Recent postsUsers plead with Borland to give up .NETIE7 to be released 18th October,... If Microsoft doesn't use UAC, why... Google's unsettling lack of direction Vista security: now prove it |