Launching Office Apps Programmatically

There are at least 9 different ways to start or connect to an Office app programmatically in managed code, as summarized in this table: PIA Interop Using the Office PIAs is the most RAD approach, with the greatest level of design-time and compile-time support. This has to be the preferred approach for almost all scenarios….


Passing Objects to Exposed Add-in Methods

I’ve posted a few times on the best way to expose methods from an add-in to automation clients – for example, here, here and here. So far, in my examples, I’ve described very simple exposed methods that take no parameters – but what happens if you want to expose a method that does take one…


Using Managed Controls as ActiveX Controls

Can you use a managed usercontrol in an Office document in the same way that you can use a native ActiveX control – all without using VSTO? Some time ago, I posted about how to use native ActiveX controls within a doc-level VSTO solution, by wrapping them in managed usercontrols. A reader (Casey) asked the…


Implementing IMessageFilter in an Office add-in

First a warning: this is an advanced scenario, and you should not attempt to use this technique unless you’re sure you know what you’re doing. The reason for this warning is that while the technique described here is pretty simple, it’s also easy to get wrong in ways that could interfere significantly with the host…


Advances in .NET Type System

Here at PDC, Misha Shneerson has just delivered a talk on a couple of very interesting new features provided by .NET 4.0. He did explain up front that these features have very broad applicability, but reading the session evals it’s pretty obvious that a lot of people didn’t get it. Probably this is because Misha…


Exposing Events from Managed Add-in Objects

Following on from my recent posts on exposing add-in objects, here and here, it occurred to me that its sometimes useful to be able to expose events from these objects. Recall that you can expose your add-in through the COMAddIn.Object property in the Office OM, either directly (in a non-VSTO add-in) or through VSTO’s RequestComAddInAutomationService…


Exciting PDC Session

Under the Hood: Advances in the .NET Type SystemThis is one session you absolutely must not miss. It looks pretty innocuous, but it’s actually a very big deal. This talk is an in-depth examination of some of the enhancements we’re making in CLR v4.0 (and in the C# and VB language compilers) to support shared-type…


AddInSpy – Diagnosing/Troubleshooting Office Add-ins

AddInSpy is a new diagnostic tool for reporting the maximum possible information about all Office add-ins registered on a machine. This is a free (unsupported) download, available on MSDN Code Gallery here. Covering article on MSDN here. In fact, there are 2 tools: AddInSpy, which is a WPF GUI application, and AS, which is a…


Version-Specific UI in Add-ins

Continuing on from my earlier posts on building add-ins for multiple versions of Office, avoiding the PIA version conflict, and add-ins for multiple versions without PIAs, a reasonable way to design your solution would be to use the lowest-common-denominator PIAs (let’s say, the Office 2003 PIAs) and then use ComImports for any additional features introduced…


COM Shim Wizard

We’ve released a slight update to the COM Shim Wizard. This is available as a free download here, and the covering article is on MSDN here. The differences Between v2.3.0.0 and v2.3.1.0 are summarized below. Setup The major difference between v2.3.0.0 and v2.3.1.0 is that v2.3.0.0 was built to install with Visual Studio 2005, whereas…