.NET Tips and Tricks

Blog archive

Adding a Menu to Office with Add-In Express

In the September issues of Visual Studio Magazine we reviewed Office Add-In Express (Build Office Apps with Add-in Express). I found that creating an Office Add-in with Add-In Express is incredibly easy.

After picking "ADX COM Add-In" from the Extensibility section of the New Project dialog, a Wizard walks you through all the choices necessary to create the initial project, including generating a strong name key file. As part of the Wizard you can choose which version of Office you're going to target (targeting Office 2000 supports all versions) and how many of the Office components you want your Add-In to integrate with. The resulting project has all the necessary references, including DLLs for both 32 bit and 64 bit systems.

Also added to your project is AddInModule.cs, which handles communicating with Office. Not only is all the necessary base code present but so are GuidAttributes added to the Class to support installing into COM. In design view for the AddInModule there is something new: a Menu across the top with about twenty options.

Seven of those options are tied to adding menus (including context menus) to Office and an additional seven are for adding items to the Ribbon (other support creating SmartTags and other Office features). While adding an item to the new Office Ribbon is notoriously awkward and difficult, with Add-In Express you just click the AdxRibbonTab option at the top of the design surface. Once you've add a AdxRibbonTab, you can add controls to it using the Controls property on the control's Property List. You even get a preview of the impact on the ribbon.

Posted by Peter Vogel on 09/17/2010 at 1:16 PM

comments powered by Disqus


Subscribe on YouTube

Upcoming Events