Click event on a self made button

C

Christoph

I have a problem with an outlook add-in and would be incredibly happy
if someone can help me.

Here the VB code:
....
Dim WithEvents objContactsButton As Office.CommandBarButton
Dim objBar As Office.CommandBar

--> At the InitHandler procedure:

Set moOL = oApp
Set moNS = oApp.GetNamespace("MAPI")
Set moActiveExplorer = moOL.ActiveExplorer
msProgID = sProgID --> parameter of this sub
Call PropertiesButton

Public Sub PropertiesButton()

Set objBar = moActiveExplorer.CommandBars("Standard")
Set objContactsButton = objBar.FindControl(Tag:="Kontakte")
If objContactsButton Is Nothing Then
Set objContactsButton = objBar.Controls.Add(msoControlButton)
With objContactsButton
.Caption = "Gemeinsame Kontakte"
.Tag = "Kontakte"
.ToolTipText = "Einstellungen für gemeinsam genutzte
Kontakte"
.OnAction = "<!" & msProgID & ">"
End With
objContactsButton.Execute
End If

End Sub


So now I would like to know the procedure–name for the click event,
where I want to open an own form window?
 
K

Ken Slovak - [MVP - Outlook]

It would be objContactsButton_Click(). Just select that button object
in the left hand drop down and the Click event should be added to your
code automatically.
 

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