I need to create and Ms-Word addin that will add a footer to all the pages of an open document. I have browsed and got some code.
I have referred MS knowledgebase article and have created an addin, but that code is not adding any button to the commandbar of Word. It did one for outlook. When I made some changes to the code to make it word specific, it still didn't do anything. I have written the following code in OnStartupComplete method:
CommandBars cmdBar = wordApp.ActiveDocument.CommandBars;
this.myButton = (CommandBarButton)cmdBar["Tools"].Controls.Add(1, oMissing, oMissing, oMissing, oMissing);
this.myButton = (CommandBarButton)cmdBar["Tools"].Controls.Add(MsoControlType.msoControlButton, oMissing, oMissing, oMissing, oMissing);
this.myButton.Tag ="Hello Butom";
this.myButton.Click += new _CommandBarButtonEvents_ClickEventHandler(this.myButton_Click);
But this is not working. I am also not able to debug it.