VSTO 2005 and Microsoft Word Bookmarks- an unlikely starting point

Alright, we have lots to discuss about Microsoft Visual Studio 2005 Tools for the Microsoft Office System (hereafter known more conveniently as VSTO 2005).

Some of you may know something about it, others may not. I could approach the topic in so many ways. In the end, I think I’ll start in an unlikely way. I will eventually explain some of the architectural stuff, how it causes us to re-think application design and so forth. But, just because I feel like it, I will focus on something simple, clear, and obvious. In the coming days, we’ll then see how deep the rabbit hole goes.

Let’s take bookmarks in Word. If you have a bookmark, here’s how you reference it in VBA:


If all VSTO did was make referencing the bookmark easier, it wouldn’t be worth our time. Fortunately, the new development tools for Office do so much more. Let’s look at how we reference the bookmark in VSTO 2005 (Beta) and see what’s really going on.

As you can see (I kept the intellisense tooltip in here), there is more happening, and it is not just cosmetic. In addition to many of the properties and methods you would expect to see for a Bookmark, there is a completely new world of Office development in play. First of all, notice that the CustomerName bookmark is an object hanging off the document object itself. If you add a new bookmark, it will automatically be added. Chang the name? It’s changed here. But, notice also the DataBindings property. This is one small example of the added power you get. You can bind your bookmark to a datasource just as you bind a dropdown to a datasource. Excel has similar functionality via named ranges.

Tomorrow, we will get into the databinding, and then we will take a step back and look at some of the bigger picture concepts with VSTO.

 Rock Thought for the day: In January, former Pumpkins/Zwan drummer released his first solo album, “Life begins again”. It’s all part of his Jimmy Chamberlin Project…project. This is a very strong effort with more of a jazz vibe than those who know better would expect. You see, before becoming the drummer for psychedelic 90’s metal/progrock/defying_category audio assault band, The Smashing Pumpkins, Jimmy was a jazz drummer. This project sees him returning more to his roots. Check it out.