How to modiy an Add-In location to CustomTab (Word)

rcisest 20 Reputation points
2023-06-23T15:45:07.8766667+00:00

When creating an Add-in with C# .NET with the followin code:

commandBar = Application.CommandBars["Standard"];
newButton = (Office.CommandBarButton)commandBar.Controls.Add(Office.MsoControlType.msoControlButton, missing, missing, missing, true);

The button added shows in the Add-In section from the ribbon.

User's image

I would like to know if there is any chance to change the position of the button from Add-ins to CustomName tab or any other of my choice?

In this case CustomName has been added with the default feature of creating new tabs that can be found in File -> Options -> Customize Ribbon

User's image

Any help provided would be extremely helpful, thanks!

Microsoft 365 and Office | Install, redeem, activate | For business | Windows
Microsoft 365 and Office | Word | For business | Windows
Developer technologies | .NET | Other
0 comments No comments
{count} votes

Accepted answer
  1. John Korchok 6,306 Reputation points Volunteer Moderator
    2023-06-24T15:47:14.67+00:00

    Sorry, there isn't. Application.CommandBars was deprecated over 15 years ago, and the Add-ins tab is a workaround for backward compatibility. You should be using RibbonUI to modify the ribbon with a Custom tab and adding your commands to that. https://learn.microsoft.com/en-us/visualstudio/vsto/walkthrough-creating-a-custom-tab-by-using-ribbon-xml?view=vs-2022&tabs=csharp

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.