Command Button Click Not Working

D

dave

I have used the Outlook Com Add In Template from Randy Bryne "Building
Applictions with Microsoft Outlook Version 2002" to create a command
button on the standard tool bar.

The button is created in the InitHandler subroutine of the OutAddIn
module as follows,

Set cbrStandard = Application.ActiveExplorer.CommandBars("Standard")
CBBTimekeeper = CreateAddInCommandBarButton(gstrProgID,
cbrStandard, "TimeKeeper", "TimeKeeper", "TimeKeeper", 190, True,
msoButtonIcon)

In the same module the click is handled with

Private Sub CBBTimekeeper_Click(ByVal Ctrl As Office.CommandBarButton,
CancelDefault As Boolean)
MsgBox "Hello World"
End Sub

In the code module the CreateAddInCommandBarButton Function assigns the
progId to the .OnAction as follows,

.OnAction = "<!" & strProgID _
& ">"

My problem is that the button shows on the Standard ToolBar but the
Click SubRoutine does not fire. I have review the code for ItemCB from
Microcode and with the exception that they are creating thier own
CommandBar I cannot not see any reason this shouldn't work.

I'm tearing my hair out over this one. Can anyone help?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top