Tim Anderson's ITWriting [Valid RSS]

Tech writing blog

Blog Home RSS Archives ITWriting.com
Add to Feedburner Add to Bloglines Add to Newsgator Add to My Yahoo

June 28, 2006

Code to create Office XML

Posted 1492 days ago on June 28, 2006

How 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.

Tags:



No comments, be the first!


Add Comment

You are welcome to comment below. For your guidance, HTML is not supported and URLs will be displayed as plain text.

 Title

 Name

 Email - Optional, not displayed

 Website. Make Public?

Your comment

Please enter this code below:

 Code

Recent posts

Users plead with Borland to give up .NET
IE7 to be released 18th October,...
If Microsoft doesn't use UAC, why...
Google's unsettling lack of direction
Vista security: now prove it


Powered by bBlog