I'm newbie with VSTO and having trouble getting my project started. I have an add-in for Word 2016 in VS 2017. When I open a docx file directly from windows file explorer, the ribbon tab appears and the button functions as it's supposed to. But if I open Word, then open a document, or create a fresh one in Word, or open Word by clicking 'start' in Visual Studio, my tab does not appear on the ribbon. I have tried adding my dll in manage COM Add-ins and it says "is not a valid Office Add-in", even though it otherwise works. The LoadBehavior in the registry is set to '3', meaning it should load automatically. This value stays regardless of whether the tab appeared or not. Any help would be hugemongously appreciated.
2 Answers
0
votes
Most probably you get an error at runtime and Office hides your customizations automatically.
By default, if a VSTO Add-in attempts to manipulate the Microsoft Office user interface (UI) and fails, no error message is displayed. However, you can configure Microsoft Office applications to display messages for errors that relate to the UI. You can use these messages to help determine why a custom ribbon does not appear, or why a ribbon appears but no controls appear.
To show VSTO Add-in user interface errors
- Start the application.
- Click the File tab.
- Click Options.
- In the categories pane, click
Advanced
. - In the details pane, select
Show VSTO Add-in user interface errors
, and then click OK.
For Outlook, the Show VSTO Add-in user interface errors
checkbox is located in the Developer
section of the details pane. For other applications, the checkbox is located in the General
section of the details pane.