nbelyh / VisioCustomMenuDemo

This minimalistic sample project shows how one can add a custom context menu to a Visio VSTO add-in using ribbon user interface definition file.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VisioCustomMenuDemo

This sample project shows how one can add a custom context menu to a Visio VSTO add-in.

  • You start off with "New Project" => "Visio VSTO Add-in".
  • Then you add a Ribbon using right click on project, then Add => New Item => Ribbon (as XML)
  • Then you can modify the Ribbon1.xml and Ribbon1.cs as in this project

image

The points that are demonstrated by this project:

  • calling the add-in code when user click the menu item (specified in the "onAction" attribute)
  • disabling/enabling/hiding menu items depending on selection
  • adding image to a menu item

Running the thing (Microsoft Visio desktop must be installed):

  • clone the repository
  • open it in Visual Sutiodio
  • Click "Run"

You should see a ribbon button added by the demo (Add-ins => Click Me) If you click it, it creates a sample diagram (where you can test the context menus)

The demo menu item ("Rectangle") just paints the selected shape to red, and adds some text to it.

context (forum topic)

About

This minimalistic sample project shows how one can add a custom context menu to a Visio VSTO add-in using ribbon user interface definition file.

License:MIT License


Languages

Language:C# 100.0%