Click event on a self made button

  • Thread starter Thread starter Christoph
  • Start date Start date
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?
 
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.
 
Back
Top