Rita
2006-06-15 21:54:02 UTC
Hi
I have created a commandbar with 1 commandbarcombo box and it's positioned
at the top of the document.Here is my code for creating a commandbar with
combo
CommandBar oStandardBar = null
oStandardBar =
(CommandBar)oWord.ActiveWindow.Application.CommandBars.Add("WordToolbar",
MsoBarPosition.msoBarTop, oMissing, true);
// Adding commandbar Combo boxes to commandbar
CommandBarComboBox cmbEntity =
(CommandBarComboBox)oWord.ActiveDocument.CommandBars["IAMWordToolbar"].Controls.Add(MsoControlType.msoControlDropdown, oMissing, oMissing, oMissing, true);
I have also set the protection for the toolbar. Code for that is:
oStandardBar.Protection =
Microsoft.Office.Core.MsoBarProtection.msoBarNoResize|
Microsoft.Office.Core.MsoBarProtection.msoBarNoMove |
Microsoft.Office.Core.MsoBarProtection.msoBarNoChangeVisible|
Microsoft.Office.Core.MsoBarProtection.msoBarNoCustomize;
With the above code i'm unable to retain the toolbar in Word since it can be
deleted using Tools > Customize > toolbars > Delete Option.
Is there any way to handle this. Any help on this is highly appreciated..
I have created a commandbar with 1 commandbarcombo box and it's positioned
at the top of the document.Here is my code for creating a commandbar with
combo
CommandBar oStandardBar = null
oStandardBar =
(CommandBar)oWord.ActiveWindow.Application.CommandBars.Add("WordToolbar",
MsoBarPosition.msoBarTop, oMissing, true);
// Adding commandbar Combo boxes to commandbar
CommandBarComboBox cmbEntity =
(CommandBarComboBox)oWord.ActiveDocument.CommandBars["IAMWordToolbar"].Controls.Add(MsoControlType.msoControlDropdown, oMissing, oMissing, oMissing, true);
I have also set the protection for the toolbar. Code for that is:
oStandardBar.Protection =
Microsoft.Office.Core.MsoBarProtection.msoBarNoResize|
Microsoft.Office.Core.MsoBarProtection.msoBarNoMove |
Microsoft.Office.Core.MsoBarProtection.msoBarNoChangeVisible|
Microsoft.Office.Core.MsoBarProtection.msoBarNoCustomize;
With the above code i'm unable to retain the toolbar in Word since it can be
deleted using Tools > Customize > toolbars > Delete Option.
Is there any way to handle this. Any help on this is highly appreciated..