1

I have created add-in for Visio but I have some problem related to Custom Panel. For implementing Custom Panel in Visio I used solution described in next link:

How can you add a Custom Panel in a Visio 2013 add-in?

My Custom Panel contain TextBoxes and Buttons. Buttons work correct and I can type text into any TextBox but I CAN'T insert text by using shortcut(Ctrl+V). When I type Ctrl+V my text is inserted in new shape of opened document. Another commands like Ctrl+X Ctrl+A etc do not work too. How can I resolve this problem?

1 Answers1

2

Visio intercepts many keyboard events before they reach your add-in. It provides "KeystrokeMessageForAddon" event though. You could check how it can be used in one of my Visio projects (it is specialized a bit for browser control but I hope it will give you an idea) https://github.com/nbelyh/HtmlFormData/blob/master/HtmlFormData/HtmlFormData/ShortcutManager.cs

Nikolay
  • 10,752
  • 2
  • 23
  • 51
  • Thanks for answer. Your add-in works well. I have tried to use "OnKeystrokeMessageForAddon" event in my application but it is never received. Also I tried to allow the "OnKeystrokeMessageForAddon" event in Event monitor of Visio but it did not help me. Do you have any ideas? – Oleksiy Kovalchyk Sep 12 '19 at 12:24
  • @OleksiyKovalchyk Well, have you subscribed to this event? https://github.com/nbelyh/HtmlFormData/blob/master/HtmlFormData/HtmlFormData/ThisAddIn.cs#L151 For the even monitor, you need to add it in options (tools -> options -> events) – Nikolay Sep 12 '19 at 19:02
  • Yes, of course. I have done this all but event does not occur. – Oleksiy Kovalchyk Sep 12 '19 at 19:13
  • Hard to tell then, especially without seeing the code.. usually it does occur. Maybe events are disabled in Visio settings? – Nikolay Sep 13 '19 at 07:20
  • Thank you for help I have resolved problem with event. My project created by Add-in Express that is why i used Interop.Visio.dll provided by it. But when library was changed to Microsoft.Office.Interop.Visio.dll, then "OnKeystrokeMessageForAddon" event started to receive. – Oleksiy Kovalchyk Sep 13 '19 at 11:08