Andrew Whitechapel

Shiny things that caught my eye

Browse by Tags

Tagged Content List
  • Blog Post: Exposing Events From Non-VSTO Add-in Automation Objects

    I posted a while back about exposing an automation object from an add-in that fires events . That post was couched in terms of VSTO add-ins. A customer asked recently how the same technique could be used in a non-VSTO add-in. So, that’s the topic of this post. First, here’s my automation object and...
  • Blog Post: 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...
  • Blog Post: 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 or more...
  • Blog Post: 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...
  • Blog Post: 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...
  • Blog Post: 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...
  • Blog Post: COM Shim Wizard 2.3.1.0

    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...
  • Blog Post: COMAddIns Race Condition

    You can expose an arbitrary object from your add-in as a kind of extension to the Office host application’s object model. To do this, you set your object as the value of the Object property on the COMAddIn object that represents your add-in in the host’s COMAddIns collection object. You can do this directly...
  • Blog Post: Why your COMAddIn.Object should derive from StandardOleMarshalObject

    In general, it is important that any code in a managed Office add-in should execute on the main UI thread. The reason for this is that there are several components that simply will not work when executed from any other but the main UI thread – examples include calls on WinForms controls, and calls into...
  • Blog Post: Demand-Loading VSTO Add-ins

    In an earlier post , I talked about how you could delay (or prevent) the loading of managed code using a native add-in. In that post I also listed the standard LoadBehavior settings, and I was assuming that everyone knows how these apply, but I got a couple of follow-up questions that prompted me to...
  • Blog Post: Add-ins for Multiple Office Versions without PIAs (Pt2), or _VtblGap

    In my last post , I discussed how you could avoid any dependency on the Office PIAs by using ComImport to redefine the host application’s OM interfaces. Someone (A Developer) pointed out that I had actually omitted the trailing 2 members of the IRibbonControl interface – and I mentioned that this wouldn...
  • Blog Post: The Case For Shared Add-ins

    People have been building native shared add-ins for Office (and related apps) since their introduction in Office 2000. People have been building managed shared add-ins since the introduction of .NET in 2002. VSTO support for managed add-ins was introduced in 2005. It is clear that the strategic technology...
  • Blog Post: Delay-loading the CLR in Office Add-ins

    Suppose you control your enterprise desktops to the extent that you control which add-ins are installed. Suppose, further, that you want to avoid the hit of loading the CLR at application startup. One way is to delay-load your managed add-ins. The registered LoadBehavior for an Office add-in governs...
  • Blog Post: Implement ICustomTaskPaneConsumer in C++

    The new extensibility interfaces introduced in Office 2007 are implementable via add-ins. Add-ins can be managed or unmanaged (native). If you're using VSTO, development is greatly simplified. However, if you want to build a native add-in to implement one of these interfaces, life is a little more complex...
  • Blog Post: VSTO Add-ins, COMAddIns and RequestComAddInAutomationService

    The COMAddIns property is a collection of COMAddIn objects exposed by Office applications that support COM add-ins. The COMAddIn interface defines a small number of methods/properties, such as the ProgId of the add-in and the Connect state. It also defines an Object property. By default, the value of...
  • Blog Post: COM Developers are from Mars, VBA Developers are from Venus, or: Typing, Binding and Wrapping in Office Development

    I paused over my final mince pie today, and pondered the psychology of Office developers (as one does). Office development is a curious mix of different programming philosophies that has given rise to a number of interesting behavioral practices among developers. I picked the title for this post because...
  • Blog Post: Interaction Between Loaded Add-ins

    Can you talk across add-ins? With the old IDTExtensibility2 model? With the new VSTO model? COM Add-ins can be accessed (from any code that can talk to the host application’s OM ) via the COMAddins collection property on the host Application object. The COMAddins object exposes 4 properties and 2...
Page 1 of 1 (17 items)