Rimantas Varanavicius
2004-09-14 11:07:09 UTC
Hello,
I can not find the way how to insert the separator between the two buttons
of custom CommandBar inserted into Office MenuBar. Can anyone help me with
some hint?
I use the following code to insert the button:
using MSOffice = Microsoft.Office.Core;
protected MSOffice.CommandBarButton CreateButton(MSOffice.CommandBarPopup
parent, string caption, string tag)
{
MSOffice.CommandBarControl cbc = null;
// Search for existing button
cbc = parent.CommandBar.FindControl(Type.Missing, Type.Missing, tag,
Type.Missing, Type.Missing);
if (cbc == null)
{ // If not found existing button - create new one cbc =
parent.Controls.Add(MSOffice.MsoControlType.msoControlButton, Type.Missing,
Type.Missing, Type.Missing, true);
cbc.Tag = tag;
cbc.Caption = caption;
cbc.Visible = true;
}
return (MSOffice.CommandBarButton) cbc;
}
I tried to look for some specific control type MsoControlType, but could not
find any.
Thank you.
regards,
Rimantas Varanavicius
I can not find the way how to insert the separator between the two buttons
of custom CommandBar inserted into Office MenuBar. Can anyone help me with
some hint?
I use the following code to insert the button:
using MSOffice = Microsoft.Office.Core;
protected MSOffice.CommandBarButton CreateButton(MSOffice.CommandBarPopup
parent, string caption, string tag)
{
MSOffice.CommandBarControl cbc = null;
// Search for existing button
cbc = parent.CommandBar.FindControl(Type.Missing, Type.Missing, tag,
Type.Missing, Type.Missing);
if (cbc == null)
{ // If not found existing button - create new one cbc =
parent.Controls.Add(MSOffice.MsoControlType.msoControlButton, Type.Missing,
Type.Missing, Type.Missing, true);
cbc.Tag = tag;
cbc.Caption = caption;
cbc.Visible = true;
}
return (MSOffice.CommandBarButton) cbc;
}
I tried to look for some specific control type MsoControlType, but could not
find any.
Thank you.
regards,
Rimantas Varanavicius