About Me

My photo
I'm currently the CTO for Hedgehog Technology a business dedicated to delivering Cloud based productivity solutions in Logistics

Thursday, March 20, 2008

It works on my machine (and a test environment) ... part 2 of VSTO deployment

I just wanted to post this because when I did a search I got only 1 hit ! Luckely it contained the solution.

Here's the story of me trying to deploy a VSTO 2008 Word template to a laptop with Office 2003;

I figured out, using the VSTO trouble shooter (see my previous post) what was going on on the machine, and on the actual target laptop everything checked out ok. But, still an error:

"File or assembly name Microsoft.VisualStudio.Tools.Applications.Runtime, or one of its dependencies, was not found." when loading the VSTO 2008 based word template in Office 2003.
Now what? I desperately googled the exact error (see above). It resulted in 1 hit, a post on a forum and 1 reply (the guy answered his own question! thanks Viking!). Turns out there was indeed a word.exe.config on that laptop, I'm still wondering how/why it got there. Removing the config-file solved my problem, the template now loads, I wonder what I've broken that required the config-file in the first place.

Here's the link to the post: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=453951&SiteID=1

I hope this will help someone else in the future....

Monday, March 17, 2008

VSTO Deployment for 2003

Last week I had some significant trouble creating an install for an Office 2003 template created in Visual Studio 2008 using VSTO 3.0 (but it works on my machine...) . Although there's a lot of docs on MSDN the information is not easy to figure out (guess there's just too much info...). Anyway today I noticed some new tools that were made available during the ODC 2008 and the trouble shooter in particular saved my day. So if you are into VSTO dev, go and get these tools!

Here's how MS describes them:

"A set of developer tools that provide additional functionality useful in Office-based development. These tools include Visual Studio add-ins as well as standalone Windows Forms and console applications. The VSTO Power Tools also include a set of re-usable class libraries to simplify Office development."

Andrew Whitechapel has blogged about this and explains in a bit more detail:


I hope these do end up as fully supported tools either seperate or as part of a Visual Studio service patch.

Monday, March 10, 2008

Labour Day - WebCasts Day!

Labour Day: One of these days that you can spend a little time exploring the stuff you had on the todo or to look at list...

I just finished looking at the SharePoint Conference Keynote one of the interesting bits to me was the announcement of a toolkit for using Silverlight in SharePoint solutions. I happen to have done some experimenting with Silverlight and SharePoint last week and there's lots of potential in that area. Just look at how the folks at General Mills have customised their search! Tafiti tailored to their business model all inside SharePoint. Here's the new toolkit:


I'm working on a personal site which has a lot of picture viewing, I hope to publish a link in the near future, but gimme some time to play with these Silverlight controls first!

Friday, March 07, 2008

LINQ 2 Outlook - Part 2

Last night after looking at what's available on LINQ and Outlook and after trying to find some info on the web on what MS might have in mind I decided to experiment with a bit of code myself.

I noticed that most samples use the Outlook collections, which are known for their not so optimum performance when they get bigger and you need to filter out a few items (basically you have to iterate through all of the items).

In Outlook 2007 there's a new class; Outlook.Table (and Row) which allows you to get to the items in a folder and apply an SQL-like filter. This is a very clean and fast way of accessing your items. Combined with LINQ here's some code I came up with, I'm looking to further optimise that using types etc. but wanted to share this simple example anyway.

static void TableTestUsingLinqAndExtensionMethod()
Outlook.Application outlook = new Microsoft.Office.Interop.Outlook.Application();
Outlook.MAPIFolder folder = outlook.GetNamespace("MAPI").GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);

string filter = @"@SQL=""urn:schemas:httpmail:subject"" like '%devcon%'";
Outlook.Table table = folder.GetTable(filter, null);

var mailitems = from mitem in table.mailitem() select mitem;
foreach (var item in mailitems)
if (item[2]!=null)
Console.WriteLine("{0}", item[2].ToString());

public static class OutlookTableExtension
public static IEnumerable mailitem(this Outlook.Table source)
if (source == null)
throw new ArgumentNullException("source");
while (source.GetNextRow()!=null)
yield return source.GetNextRow();

Try it out on some large collections and you'll see it is surprisingly fast!

Thursday, March 06, 2008

LINQ 2 Outlook

During the keynote at the Heroes Happen {2008} launch event in Melbourne last Tuesday Jason Zander, the General Manager of the Visual Studio team made a quick reference to what he called Linq 2 Outlook which would come out of Redmond in the near future. On the search for info on this I stumbled upon many bloggers already using Linq against the Outlook object model. A very interesting approach comes from Belgium, good stuff from Stefan Cruysberghs. Seriously worth having a look at if you're into Linq (and /or Outlook 2007). He also wrote a class for accessing OneNote 2007.