I recently did a bit of work on generating Word 2007 documents using OpenXML. Basically, I had a standard XML document and I needed to generate a Word document from it. The process I came up with involved creating a "template" document in Word, examining the contents of the package, using XSLTs to transform the original XML into OpenXML and packaging it into the template. This actually seemed to work quite well and was far more efficient than using Office Interop for server-side document generation.

I've put together a few of videos describing the end-to-end process of examining a Word 2007 document package, generating OpenXML and using the System.IO.Packaging namespace. They are currently available as downloads from my website, but if there's enough demand I'll re-jig them and put them up on youtube. Here are the links:

Generating OpenXML Documents Part 1

Generating OpenXML Documents Part 2

Generating OpenXML Documents Part 3

If you've seen OpenXML before and you just want to get into the meat of how to use the Packaging namespace, then feel free skip the first two and go straight for part 3.

So generally, here's how it all works:

  • Create a new Word 2007 document and format it according to what you'd like the generated document to look like.
  • Pull apart the document "package" by simply changing the extension to zip and extracting it.
  • Examine the parts of the package that you need to modify to generate the document. This is usually the "word/document.xml" file, but can also include files like "word/_rels/document.xml.rels" if you are adding relationships such as images to the document.
  • Create an XSLT to transform your original XML data into the OpenXML represented by "word/document.xml".
  • Use the System.IO.Packaging namespace to package the transformed XML and any images into (a copy of) the template file.

Let me know what you think... :)

I've finally got my new computer! :)

It arrived about 2 weeks ago and I've finally got everything up and running just the way I like it.

Specs

  • Dell XPS m1330
  • Intel Core 2 Duo T770 @ 2.4GHz
  • 4GB DDR2 667MHz RAM
  • 64GB SSD Hard Drive
  • NVIDIA GeForce 8400M GS 128MB DDR3
  • 13.3" WLED with 0.3MP Webcam
  • Fingerprint reader
  • Bluetooth
  • Wireless a/b/g/n
  • 6-cell battery

Why the m1330?

I decided on this laptop because after a few weeks of travelling interstate for work I realised that I wanted something that was more portable than those big ol' D820's. This machine is easy to carry in one hand and comfortably fits on the tray in an economy flight, while keeping up the pace with a powerful chip and lots of memory. For those interested, I have posted a few photos of the unboxing. Now let the chronicles begin...

Setup

The first thing I did after unboxing was blow away the partitions. I really didn't want 10 of 64 GB dedicated to recovery so the standard set up was a bit of a problem. I also decided it would be a good chance to give a 64-bit operating system a go. When I purchased the laptop, I ticked the Windows Vista Ultimate 32-bit but I thought I'd try my luck at installing Vista Ultimate 64-bit because the T7700 has EM64.

Anyway, after the initial installer went through the OS wouldn't boot, but instead kept blue-screening. I switched on to this forum post which describes the process of installing 64 bit Vista on the m1330. One of the first things mentioned is this nasty BSOD problem where the OS won't start because the right AHCI driver isn't installed. So I did as it said and turned the SATA mode to ATA, which meant the OS would start but I couldn't get AHCI working because the default driver was not the right one.

After a while of trying to get ACHI and Flash Cache working by balancing a water bottle on my head while standing on my hands and pressing the install button with my toes, I ran into Jeff Atwood's m1330 review which mentions installing the driver while Vista is installing. D'oh! Why didn't I think of that...?!

Ok, so after a couple of nights mucking around I've finally got an installation of 64-bit Vista that's working properly with the SSD hard drive working at full capacity. So I installed more of the drivers that were attached to the forum post and things started coming together nicely. I actually didn't install the video card and fingerprint reader drivers recommended. Instead, I waited for Windows Update to pick them up and it did it for me. I think the most important thing with this process is to install the necessary things to get you up and running so you can connect the net and let Windows update itself.

Media Direct

Now, I did something naughty when I was installing Vista... I forgot to use the Media Direct CD to partition my hard drive. What does this mean? Simply that I don't have any Media Direct functionality anymore.

I thought I could live with that until I decided to press the little home button while my computer was off. This actually tried to start Media Direct which gave me a lovely little "NTLDR is missing" message. Time to freak out right...? Well, an hour later, after trying fixmbr and all the rest, I decided to hit the same home button while the laptop was off and voiala, Windows boot screen. Lesson learnt.

Another bad thing about not having the Media Direct software installed is that hitting the home button while Vista is running doesn't run Media Center anymore. This is quite sad because (as some of you already know) I'm quite lazy, so I'm not quite happy using the mouse to select it from the start menu.

Activating Windows Vista 64 bit with 32 bit OEM Key

Next came activating Windows. I was quite scared off the concept of attempting to install the 64-bit Vista with the OEM key provided with the laptop because not many people at all reported success. Being the cowboy I am, I thought I'd give it a go. Once I had connected to the net a couple of times, Windows informed me that the key I've used can't be activated. So I called the call centre and after typing in the 48 digit installation ID the automated voice told me that it was invalid, so I transferred to an operator. I explained the situation to the operator and she kindly gave me the correct digits to activate Windows. Woot! :)

Performace

I don't know if this can fully justify the price of the SSD, but here's the HDTune stats...

 

Sweet hey...? :)

And the WEI...

 

For a 13.3" that weighs 2kg, I think that's pretty darn good.

I tried to run a PCMark05, but ran into a few issues and it wouldn't give me a score. Oh well...

My Conclusion

This is a powerful little unit. Personally, I'm loving it. I've paired it with a WD Passport 250GB and use it to store my Virtual PCs that I've created as development environments.

The only downsides I've found are that it only has 2 USB ports and the WLED screen runs a resolution of 1280x800, which is low even by 13" standards. But the size is definitely a plus for me because I don't even feel it on my back when I'm travelling and it's actually feasible to use on a plane. Also, it fits into almost any backpack so I've shunned that disgraceful tech.ed delegates bag.

Having said that, now that the m1530 is out, I'd be torn between them if I was making the same purchasing decision...

Ok, so I'm back from Bora Bora and it's back to work... :(

I've uploaded a few of my photos from the holiday here. Overall, we had a great time and came back very relaxed.

We got the chance to do a bit of snorkelling and canoeing, which was a lot of fun. But realistically, I think we enjoyed lounging around the most. :)

Clare and I have decided that we deserved a bit of time to our selves, so we've escaped to Tahiti for a week... :)

Today is our second day in the beautiful island of Bora Bora. We're staying in the Le Meridien resort and absolutely loving it. We have our own little overwater bungalow with a glass floor and a ladder from the balcony into the gorgeous blue water.

After arriving yesterday, we basically spent the entire day chilling out and frolicking in the water. Today we basically did much the same. We got to see the turtles being fed this morning though, which was quite fun. We planned on using the snorkelling gear they've given us to have a swim with the fish and turtles in the lagoon, but just never got around to it...

Over the next few days we plan on doing stuff like kayaking, canoeing and windsurfing, but it's so tempting to just sit on the balcony and soak up some rays.

Unfortunately, I had a bit of a BF moment and forgot to pack the USB cable for my camera so photos are going to have to wait a while. Until then, I took a quick one of the view from the balcony with the webcam on my new laptop (which I will blog about eventually...).