直接从形状操作调用 C# 插件方法
我有以下设置:我使用 VSTO 为 Visio 2010 编写了一个加载项,该加载项向 UI 添加了另一个功能区。通过这个用户界面,可以打开新表单并做一些很酷的事情。
使用我重写的旧版本工具,可以右键单击形状并直接从形状打开表单。这是通过向形状添加一个操作来完成的,如下所示:
=RUNADDON("VS2.EXE")
其中 VS2.exe 是打开另一个表单的可执行文件(必须位于 Visio 的搜索路径中)。
我的问题是,是否有一种简单的方法可以从形状操作内部调用加载项/功能区中的方法?类似的东西:
=RUNADDON("MyAddIn.MyMethod()")
我发现的相关信息(但没有回答这个问题)是
- 如何从单独的 C# 项目调用 VSTO AddIn 方法?
- http://msdn.microsoft.com/en-us/library/bb608621.aspx< /a>
- http://msdn.microsoft.com/en-us/library/aa200979%28office.10%29.aspx
- http://msdn.microsoft.com/en-us/library/ff767833.aspx
感谢您的回复或建议。
I have the following setting: I wrote an add-in for Visio 2010 with VSTO and this add-in adds another ribbon to the UI. From this user-interface, it is possible to open new forms and do some cool stuff.
With the elder version of the tool I rewrote, it was possible to right-click on a shape and open a form directly from the shape. This was done, by adding an action to the shape that looked like:
=RUNADDON("VS2.EXE")
where VS2.exe was the executable that opened another form (which had to be in the search-path of Visio).
My question is, if there is an easy way of calling a method in the add-in/ribbon from inside of the shape action or not? Something like:
=RUNADDON("MyAddIn.MyMethod()")
Related information I found (but didn't answer this question) were
- How to call a VSTO AddIn method from a separate C# project?
- http://msdn.microsoft.com/en-us/library/bb608621.aspx
- http://msdn.microsoft.com/en-us/library/aa200979%28office.10%29.aspx
- http://msdn.microsoft.com/en-us/library/ff767833.aspx
Thanks for any reply or suggestion.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果要从 ShapeSheet 调用外接程序中的操作,则需要使用以下两个函数之一引发事件:
QUEUEMARKEREVENT("My ContextString")
请参阅 https://msdn.microsoft.com/en-us/library/ office/ff767955.aspx
RUNADDONWARGS("QueueMarkerEvent","My ContextString")
请参阅 https://msdn.microsoft.com/EN-US/library/ office/ff768158.aspx
第一个是较新的,专门为此目的而制作。
您的外接程序需要侦听 Application.MarkerEvent 以捕获引发的事件。
Visio SDK中有示例
If you want to call an action in your add-in from the ShapeSheet, then you need to raise an event using either of the two following functions:
QUEUEMARKEREVENT("My ContextString")
See https://msdn.microsoft.com/en-us/library/office/ff767955.aspx
RUNADDONWARGS("QueueMarkerEvent","My ContextString")
See https://msdn.microsoft.com/EN-US/library/office/ff768158.aspx
The first one is newer and made specifically for this purpose.
Your add-in needs to be listening to the Application.MarkerEvent to capture the raised events.
There are examples in the Visio SDK