What's missing in the following code, for the .Caption
gets bellow and the icon on the top?
Sub SoundLogToolbar()
Dim cb As CommandBar
Dim de As CommandBar
Dim but As CommandBarButton
Dim picPicture As IPictureDisp
On Error Resume Next
MkDir "C:\SoundLog\"
On Error GoTo 0
On Error Resume Next
MkDir "C:\SoundLog\Presentations\"
On Error GoTo 0
Set picPicture = stdole.StdFunctions.LoadPicture("C:\SoundLog\Presentations\SoundLog.gif")
On Error Resume Next
Application.CommandBars("SoundLog").Delete
On Error GoTo 0
Set cb = Application.CommandBars.Add("SoundLog", msoBarTop, , True)
Set but = CommandBars("SoundLog").Controls.Add(msoControlButton)
but.Visible = True
With but
.Picture = picPicture
.OnAction = "ShowUserForm"
.Caption = "SoundLog!"
.TooltipText = "run this to get data!"
.Style = msoButtonIconAndCaptionBelow
End With
cb.Visible = True
End Sub
With the msoButtonIconAndCaptionBelow
button style, it wasn't suppose to be like I want?