Outlook and Word Toolbars mixed: problem and solution
Have you ever run into the issue when an Outlook toolbar created by your add-in shows up in Word? Or maybe, a Word toolbar gets displayed in Outlook? This article describes the issue and provides a workaround; the source code is supplied in VB.NET, C# and Delphi.
Add-in description: An Outlook add-in showing a custom command bar in the Outlook Inspector window. Or, a Word add-in showing a custom command bar.
- Outlook 2000, 2002, 2003
- Word 2000, 2002, 2003
Problem description: When Word is used as the default email editor, custom Outlook Inspector command bars get shown in Word. Similarly, a custom Word commandbar shows up in the Outlook Inspector window.
Side issues: A commandbar popup shown on the Outlook commandbar displays no controls (empty popup).
Workaround: To bypass this, the add-in must support both Word and Outlook. When loaded in Word, the add-in hides the Outlook commandbar; when loaded in Outlook inspector, it hides the Word commandbar. As a rule, command bars must be created as temporary in Outlook and permanent in Word. However, if Word is the default email editor, the add-in must create the Outlook inspector toolbar as permanent; this prevents the popup from getting empty. Doing this creates the necessity to run Word in order to remove the toolbar when the add-in is uninstalled. Because it is impossible to run the application for an arbitrary user account on the given PC, you cannot remove the permanent Word toolbar for all user accounts on the PC. That is, the resulting add-in can be installed on the per-user basis only.