Hello, I'm trying to create an add-in to Word in forms of a toolbar. I am using an example from MSDN but I get an error message "Word.Application does not contain a definition for CommandBars".
Here is the function that is called and causes the error:
private Microsoft.Office.Core.CommandBar AddWordToolbar( Word.Application word, string toolbarName) { Microsoft.Office.Core.CommandBar toolBar = null; try { // Create a command bar for the add-in object missing = System.Reflection.Missing.Value; toolBar = (Microsoft.Office.Core.CommandBar) word.CommandBars.Add(toolbarName, //<- Here is the probl Microsoft.Office.Core.MsoBarPosition.msoBarTop, missing, true ); toolBar.Visible = true; return toolBar; }