使用AddAdvise方法插入和删除形状表中的行(Visio 2013) [英] Using AddAdvise method for insertion and deletion of a row in the shape sheet (Visio 2013)

查看:91
本文介绍了使用AddAdvise方法插入和删除形状表中的行(Visio 2013)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个可以通知我在Visio 2013中任何形状的形状表中插入和删除行的事件。由于Visio没有提供,所以我尝试使用$ b $创建一个b EventList.AddAdvise Method(Visio)。这是我的代码:

I need an event which can notify me about insertion and deletion of a row in the shape sheet of any shape in Visio 2013. As Visio doesn't provide one so I am trying to create one using EventList.AddAdvise Method (Visio). Here is my code:

/* clsEventSink is class that implements the IVisEventProc interface */
clsEventSink sinkObj = new clsEventSink();

/* Here doc = Visio.Document object */
Visio.EventList evtList = doc.EventList;

evtList.AddAdvise(unchecked((short)Visio.VisEventCodes.visEvtRow + (short)Visio.VisEventCodes.visEvtAdd), sinkObj, "", "Row Added.");

但代码抛出了这条消息的异常:"发生了异常。"

But the code is throwing an exception with this message: "An exception occurred."

虽然我也尝试使用AddAdvise方法有三个其他事件代码(如下面的代码所示),工作正常:

While I also tried to use AddAdvise method with three other event codes (as shown in code below), which are working fine:

/* clsEventSink is class that implements the IVisEventProc interface */
clsEventSink sinkObj = new clsEventSink();

/* Here doc = Visio.Document object */
Visio.EventList evtList = doc.EventList;

evtList.AddAdvise((short)Visio.VisEventCodes.visEvtCodeDocSave, sinkObj, "", "Document Saved.");

evtList.AddAdvise((short)Visio.VisEventCodes.visEvtCodeShapeDelete, sinkObj, "", "Shape Deleted.");

evtList.AddAdvise(unchecked((short)Visio.VisEventCodes.visEvtPage + (short)Visio.VisEventCodes.visEvtAdd), sinkObj, "", "Page Added.");

任何人都可以就此问题提出任何建议吗?

Can anyone suggests anything about this issue?

提前致谢!

推荐答案

Hi,


EventList.AddAdvise方法(Visio)
,您可以找到:

In EventList.AddAdvise Method (Visio), you could find:

事件常量由Visio类型库声明,并以visEvt为前缀。要查找要创建的事件的事件代码,请参阅事件代码。

Event constants are declared by the Visio type library and are prefixed with visEvt. To find an event code for the event you want to create, see Event codes.

根据
事件代码(Visio)

所以我认为我们无法为行添加创建事件。

So I think we are unable to create an event for row adding.

问候,

Celeste


这篇关于使用AddAdvise方法插入和删除形状表中的行(Visio 2013)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆