Hi,
I am trying to add a button to the standard commandbar in Microsoft Word. I am able to create a new commandbar and add a button to the new commandbar but when I get a handle to the standard commandbar and trying and Add a button I get a COM exception "Error HRESULT E_FAIL has been returned from a call to a COM component". The code I am using to add the button is:
Code BlockMicrosoft.Office.Core.
CommandBar commandbar = ThisDocument.CommandBars["Standard"];
Microsoft.Office.Core.CommandBarButton commandBarButton = (Microsoft.Office.Core.CommandBarButton) commandbar.Controls.Add(1, missing, missing, missing, missing);
Any help would be appreciated.