I’m struggling with how to best start this post. Here are a few possibilities:
- I like to think that I’m a hard person to impress. But…
- I swear at my computer many times a day, but usually in anger and almost never in delighted surprise.
- Someone deserves a raise.
- Holy crap!
All of them apply, so you can take your pick.
But what am I talking about?
I’m talking about the DocumentReflector tool that’s included with the Open XML Format SDK v2.0.
You see, I’ve been playing today with a few Office development tasks today for a work-related project. I’ve never looked too closely at working with the Office Open XML file format before this week; I’ve read white papers and such, but until you start writing your own code you never really “get” what an API is all about. After a few false starts and many searches, I was less than impressed.
But then I discovered DocumentReflector. This is a stand-alone SDK tool that will (wait for it) let you open an Office Open XML document, select a subset of the document or the entire document and it (here it comes) displays the C# code that will create it.
Holy crap indeed.
I’m sure I’ll be swearing at this amazing tool before the weekend is over (the new wears off pretty quickly for me) but today whoever built this app is officially my hero.
Edit: I almost forgot to add – there’s a great overview of using this tool on Erika Ehrli’s blog, here.
Now I can’t help but ask why we don’t have a tool like this for SSIS packages. Wouldn’t it be great to point a utility at a DTSX file and have it output the code required to build that package through the SSIS API? ;-)