Option
Explicit
Public
WithEvents
MyButton
As
Office.CommandBarButton
Public
OnAction
As
String
Private
Sub
MyButton_Click(
ByVal
Ctrl
As
Office.CommandBarButton,
CancelDefault
As
Boolean
)
Dim
str()
As
String
str = Split(OnAction,
" "
)
Select
Case
UBound(str)
Case
0
Run str(0)
Case
1
Run str(0), str(1)
End
Select
End
Sub
Public
Property
Let
Caption(Wert
As
String
)
MyButton.Caption = Wert
End
Property
Public
Property
Get
Caption()
As
String
Caption = MyButton.Caption
End
Property
Public
Property
Let
Tag(Wert
As
String
)
MyButton.Tag = Wert
End
Property
Public
Property
Get
Tag()
As
String
Tag = MyButton.Tag
End
Property
Public
Property
Let
FaceID(Wert
As
String
)
MyButton.FaceID = Wert
End
Property
Public
Property
Get
FaceIde()
As
String
FaceID = MyButton.FaceID
End
Property
Public
Property
Let
DescriptionText(Wert
As
String
)
MyButton.Caption = Wert
End
Property
Public
Property
Get
DescriptionText()
As
String
DescriptionText = MyButton.DescriptionText
End
Property
Public
Property
Let
TooltipText(Wert
As
String
)
MyButton.Caption = Wert
End
Property
Public
Property
Get
TooltipText()
As
String
TooltipText = MyButton.TooltipText
End
Property