K
Kim Gräsman
Hi all,
I've built a COM add-in that adds two simple buttons to the Outlook toolbar,
with code similar to this:
<translated from="C++" mode="freely">
Dim objCommandBar
Set objCommandBar =
objApplication.ActiveExplorer.CommandBars.Item("MyCommandBarName")
If objCommandBar Is Nothing Then
Set objCommandBar =
objApplication.ActiveExplorer.CommandBars.Add("MyCommandBarName", msoBarTop,
, False)
End If
Dim objMyFirstButton As _CommandBarButton
Set objMyFirstButton = objCommandBar.Controls.Item(1)
If objMyFirstButton Is Nothing Then
Set objMyFirstButton = objCommandBar.Controls.Add(msoControlButton,
, , , False)
objMyFirstButton.Style = msoButtonCaption
objMyFirstButton.Visible = True
objMyFirstButton.Caption = "My First Button"
objMyFirstButton.Enabled = True
objMyFirstButton.ToolTipText = "The first button I ever added"
End If
Dim objMySecondButton As _CommandBarButton
Set objMySecondButton = objCommandBar.Controls.Item(2)
' Same treatment for this one
' Sink events for the two buttons
</translated>
I'd like to make the two buttons part of the same dropdown button - how
would I go about that? Either I'm looking at the wrong documentation, it's
fairly hard to understand, or I'm just stupid.
I figured it's got something to do with the msoControlButtonDropDown style,
but I can't seem to get the two buttons on the same dropdown.
Many thanks for any leads.
I've built a COM add-in that adds two simple buttons to the Outlook toolbar,
with code similar to this:
<translated from="C++" mode="freely">
Dim objCommandBar
Set objCommandBar =
objApplication.ActiveExplorer.CommandBars.Item("MyCommandBarName")
If objCommandBar Is Nothing Then
Set objCommandBar =
objApplication.ActiveExplorer.CommandBars.Add("MyCommandBarName", msoBarTop,
, False)
End If
Dim objMyFirstButton As _CommandBarButton
Set objMyFirstButton = objCommandBar.Controls.Item(1)
If objMyFirstButton Is Nothing Then
Set objMyFirstButton = objCommandBar.Controls.Add(msoControlButton,
, , , False)
objMyFirstButton.Style = msoButtonCaption
objMyFirstButton.Visible = True
objMyFirstButton.Caption = "My First Button"
objMyFirstButton.Enabled = True
objMyFirstButton.ToolTipText = "The first button I ever added"
End If
Dim objMySecondButton As _CommandBarButton
Set objMySecondButton = objCommandBar.Controls.Item(2)
' Same treatment for this one
' Sink events for the two buttons
</translated>
I'd like to make the two buttons part of the same dropdown button - how
would I go about that? Either I'm looking at the wrong documentation, it's
fairly hard to understand, or I'm just stupid.
I figured it's got something to do with the msoControlButtonDropDown style,
but I can't seem to get the two buttons on the same dropdown.
Many thanks for any leads.