Extensions to our ribbon
Our Rules Tools group in the Process tab of the Visio ribbon needs to be extended to include our new features. The features can be viewed in the following screenshot:
![](https://static.packt-cdn.com/products/9781849680141/graphics/0141_06_01.jpg)
There are four new buttons required. They are:
Annotate
Report
Export
Import
These are added to Ribbon.xml
and the relevant callbacks are added to the Ribbon
class.
The Annotate button is enabled for all diagrams, but the other buttons are only enabled when the Rules Explorer window is open, and I have arranged them on the dropdown menu of a split button.
The OnAction
event of the Annotate button checks whether the active page type is a visTypeForeground
. This is because a user may inadvertently be on a reviewer (visTypeMarkup) or background (visTypeBackground) page when the button is clicked. This is explained further in the next section.
case "buttonAnnotate": Globals.ThisAddIn.OnActionAnnotateIssues(); break;
The ThisAddin
class has the following method:
public void OnActionAnnotateIssues() ...