Article ID: 826931 - Last Review: May 11, 2007 - Revision: 3.2 Click event is not raised for a custom Word CommandBarButton objectOn This PageSYMPTOMSYou can create a Microsoft Office Word 2007 document or a Microsoft Office Word 2003 document that uses a managed code extension. You can create the managed code extension with Microsoft Visual Studio Tools for the Microsoft Office System 2003. The code extension creates a CommandBarButton object in one of the built-in CommandBar objects in Word. When you click this CommandBarButton object, the Click event does not occur in the managed code extension. The result is that you cannot determine when a user tries to access your custom CommandBarButton object. CAUSEThis problem occurs when the Tag property of the CommandBarButton object is not set to a value. STATUS
This behavior is by design. MORE INFORMATIONThe Tag property permits Microsoft Office to uniquely identify the CommandBarButton object. This is particularly useful in Word because Word uses Single Document Interface (SDI). SDI permits each document window to have its own set of commandbars. Therefore, Microsoft recommends that you always set the Tag property to a unique string for each CommandBarButton object that you create. This is especially important when you add your own CommandBarButton object to existing Word command bars such as menus, context menus, and toolbars. Steps to reproduce the problemThe following steps create a new CommandBarButton object from the Tools menu in Word. To see that the Click event does not occur unless you set the Tag property of the CommandBarButton object, follow these steps:
| Article Translations
|
Back to the top
