I am new to Word AddIns and trying to add Ribbon Group (s). for each RibbonGroup I dynamically add RibbonMenu and then add RibbonButtons to the menu within the group.
I got a rough job and it seems like it's ok, but whenever I access any collection
for example: group1.Items.add (new RibbonButton ()); it throws me to say that Collection is ReadOnly.
But when I debugged the Collection IsReadOnly checkbox, set to False, which clearly states that Collection is not readonly?
What am I missing.
, .
. http://msdn.microsoft.com/en-us/library/bb608623.aspx#SettingReadOnlyProperties
RibbonMenu RibbonGroup? , , , , [ , group1 - , !].RibbonMenu, RibbonGroup , .Items RibbonGroup:
// Summary: // Gets the controls in the group. // // Returns: // The collection of controls in the group. // // Exceptions: // System.InvalidOperationException: // You try to add, remove, or replace a Microsoft.Office.Tools.Ribbon.RibbonControl // after the Ribbon is loaded. IList<RibbonControl> Items { get; }
, , IsReadOnly false.RibbonGroup , .
. RibbonMenu , True RibbonMenu ( ), .