Tuesday, April 27, 2010

Installing Pre-Requisite Assemblies For VSTO Applications

If you've read my previous post How to Deploy a VSTO Word Template Application you would probably be thinking cool, nothing else to it. But...

If you were like me and were trying to install it into an environment that had absolutely none of the pre-requisites then I'm guess you would be getting an exception that went along the lines of "The common language runtime could not be loaded by ... "

What the heck does this mean? If you were like me, you'd be scouring the web and coming up with pages that reference the pages you've already looked at. Useless!

It wasn't until a mate at Readify, Jake Ginnivan, that if the box doesn't have the .net framework then it can't even read the VSTO file to know what to do.

The solution: the user needs to run the Setup.exe manually! Once this is done, the user can then go and open up the office document (mine was a word template). Now that the pre-requisite assemblies are there the VSTO app can now get installed. Hallelujah!

I hope this has helped.

Enjoy!

Wednesday, April 21, 2010

How to Deploy a VSTO Word Template Application

I recently had to build a word macro that read an Excel spreadsheet and produced a series of PDF files that were then sent out to an email that existed within each row.

The approach that I took was to develop a VSTO Word Template application that would step the user through the process of selecting the spreadsheet, reading the data and finally processing the data.

Step One - Creating the Application
To create a Word Template application is relatively straight forward. From the New Application dialog browse for Office > 2007 > Word 2007 Template. You should now be presented a .dotx file that you can now customise to your hearts content.

Step Two - Adding the Controls to Template
Not having worked with a VSTO application before I simply copied the RichTextContentControl from an example application I found. However, like any .Net application all the controls that can be utilised in the Word Template can be found in the toolbox. (Thanks Mr Obvious!)

Here's what mine looked like...

Step Three - Adding the Actions Pane Control
Just having some controls embedded in a template isn't going to do a lot, you need some way for the users to interact with the template. This is where the Actions Pane Control comes in play.

Here's what mine looked like...


So you can basically added all manner of controls to the Action Pane and treat it like a Windows Form.

Step Four - Deploying
Developing all of the above is fairly straight forward, just like developing a web/win app, F5 and away you go. But how to deploy that was a little different.

Googleing "How to deploy a VSTO word template application" and the like continued to give me information on the problems people were having. Not very helpful! Thankfully due to the awesome resources available from Readify I was eventually pointed to the following links:




These links are your one stop shop for deploying VSTO applications.

Enjoy!

[Edit]
I also came across these screencasts yesterday. They provide an awesome walk through of the deployment process.
VSTO: Deployment via ClickOnce screencast and VSTO: Deployment via SharePoint

Next: Installing Pre-Requisite Assemblies For VSTO Applications

Friday, April 9, 2010

A New Beginning

Well last Wednesday, 7th April 2010, marked a new beginning for me as I started at Readify as a Senior Developer.

I hadn't been 100% happy at my previous employer and so I had begun priming myself for my application as soon as my 12 months was up. Unfortunately for my previous employer I started attending Sydney's ALT.NET User Group and told Richard Banks of my intent. His response was as simple as "well... we're looking for approximately 10 developers right now." and he left it at that.

Needless to say the rest is history and here I am now a proud Readifarian.

But wait! There's more!

Readify are still looking for more developers (2 for VIC and 5 for ACT/NSW plus a SharePoint guru for WA) who can also experience the awesome benefits of working for Readify.

Enjoy!