PowerPoint Add-In Add a Button and addHandler

vbrules

New member
Joined
Mar 29, 2012
Messages
1
Programming Experience
3-5
Hi,

with the following code I add a button to the current slide in PowerPoint (at runtime):

oControl = oSlide.Shapes.AddOLEObject(20, 20, 10, 0, ClassName:="Forms.CommandButton.1")
With oControl
.OLEFormat.Object.Name = "Button1"
.OLEFormat.Object.Caption = "Test"
.OLEFormat.Object.Font.Bold = True
.OLEFormat.Object.Font.Name = "Verdana"
.OLEFormat.Object.BackColor = RGB(0, 255, 0)
.OLEFormat.Object.ForeColor = RGB(255, 255, 0)

End With



Now I would like to add a handler for the button "Button1" to trigger Button1_Click() , but I don't know how I can do this.

Private Sub MeineCheckbox_Click()

MsgBox("hallo")
End Sub
 
Back
Top