I have a custom contorl bar button and it is connected to an addin. When my addin is first loaded the button is first displayed in the middle of the screen. I then need to drag it to the control bar.
Is there any way I can code it so that it goes straight to the control bar and not in the middle
Note: I have also asked this question at http://www.ozgrid.com/forum/showthread.php t=51966
Thank you

Custom button on control bar
advent.children
PETRU ROTARIU
This is what i have. It is in its own sub that i made:
Private Sub AddButton(objectCommand As CommandBar, buttonName As String, _
actionName As String, iconPicture As IPictureDisp, bBeginGroup As Boolean)
Dim objectCommandButton As CommandBarButton
Set objectCommandButton = objectCommand.controls.Add(msoControlButton)
With objectCommandButton
.Caption = buttonName
.OnAction = actionName
.BeginGroup = bBeginGroup
.Style = msoButtonCaption
.Picture = iconPicture
End With
End Sub
hasdkljakldjs
per our support engineer:
Please try the code below:
Dim oCommandButton As CommandBarButton
Set oCommandButton = oCommand.Controls.Add(msoControlButton)
oCommandButton.Style = msoButtonCaption
Then the button can be added in the controls.
-brenda (ISV Buddy Team)