A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
To correct errors when adding a Ribbon (Visual Designer) to a Word VSTO project, verify the following steps and prerequisites that Visual Studio and Office require:
- Confirm Office and PIAs are installed
- The target Microsoft Office application (Word) must be installed on the development computer, including the primary interop assemblies (PIAs).
- If Office/Word is missing or incomplete, Visual Studio can show errors or prevent running/debugging the VSTO project. In that case, install or repair Office as described in the Office configuration guidance.
- Add the Ribbon item correctly
- In Visual Studio, open the Word VSTO project.
- On the Project menu, select Add New Item.
- Choose Ribbon (Visual Designer) (or Ribbon (XML) if XML customization is required).
- In the Name box, enter a valid name that does not contain any of the disallowed characters:
-
#,%,&,*,|,\,:,",<,>,?,/, leading/trailing spaces, or reserved names such asnul,aux,con,com1,lpt1, and so on.
-
- Click OK. Visual Studio will add:
- A Ribbon code file (for event handlers and logic).
- A Ribbon Designer code file (generated code; do not edit directly).
- A resource file (stores control property values).
- Use the correct customization model
- Use Ribbon (Visual Designer) when the visual designer capabilities are sufficient.
- Use Ribbon (XML) if the customization needed is not supported by the designer. Visual Studio will then generate a Ribbon XML file and a Ribbon code file that implements
IRibbonExtensibilityandGetCustomUI.
- Enable UI error reporting in Word
- If the Ribbon is added but does not appear or behaves incorrectly, enable VSTO UI error messages in Word:
- Start Word.
- Select the File tab.
- Select Options.
- Select Advanced.
- In the General section, select Show VSTO Add-in user interface errors, then click OK.
- Any Ribbon load or callback errors will then be surfaced, helping pinpoint the issue.
- If the Ribbon is added but does not appear or behaves incorrectly, enable VSTO UI error messages in Word:
If the error is specifically that Visual Studio reports Office/Word is not installed for the project type, install or repair Word (with PIAs) and then reopen the project and re-add the Ribbon item.
References: