-
This is really annoying the sh*t out of me!!!
Does anyone know how to declare and use the CommandBarEvents property?
The docs say you need to set your WithEvents variable to a CommandBarControl object, but I can't find one. All CommandBar Controls seem to be sub-divided into CommandBarButtons, CommandBarPopups and CommandBarComboBoxs.
I'm trying to capture a click on the VBIDE 'New Project' in the File menu - I just can't get it working, I'm getting Type Mismatch because I can't find a god-damn CommandBarControl...
Somebody come to my rescue or its seppuku time.
-
Sussed it...
Its OK people...I figured it out.
I was negelecting to use:
VBE.Events.CommandBarEvents(CommandBarControl)
Talk about torturous!
************************************************
By the way, I'm needing to trap the click events on a few menu items and it would seem more sensible to trap the click on, for instance, the file menu, then select case for the specific control clicks I want to react to.
Is this possible? Generally the way its done? Or do I have to set a withg events for every control invidiually?
-
Where do we find CommandBar Control...I checked components under Project(since it wasn't there on ToolBox) but cudn find it...
thanks
neelesh
-
CBC
CommandBarControls are the underlying controls of menus and toolbars in office applications.
Look in your Object Browser for CommandBar etc.
(part of the Office library).