Table of contents
TOC
折叠目录
展开目录

DrawingControl.QueryCancelDocumentClose 事件 (Visio)DrawingControl.QueryCancelDocumentClose Event (Visio)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

在应用程序关闭文档以响应界面中的用户操作之前发生。如果任何事件处理程序返回True ,则取消此操作。Occurs before the application closes a document in response to a user action in the interface. If any event handler returns True , the operation is canceled.

语法Syntax

专用子_表达式__QueryCancelDocumentClose( [IVDOCUMENT] 为 ByVal doc )Private Sub expressionQueryCancelDocumentClose( **_ByVal doc As [IVDOCUMENT]** )

表达式_一个表示DrawingControl对象的变量。_expression A variable that represents a DrawingControl object.

参数Parameters

名称Name必需/可选Required/Optional数据类型Data Type说明Description
docdoc必需Required[IVDOCUMENT][IVDOCUMENT]要关闭的文档。The document that is going to be closed.

注解Remarks

用户具有定向要关闭文档的实例之后,Microsoft Visio 实例将触发QueryCancelDocumentCloseA Microsoft Visio instance fires QueryCancelDocumentClose after the user has directed the instance to close a document.

  • 如果任何事件处理程序返回True (取消),实例将触发DocumentCloseCanceled ,并不关闭文档。If any event handler returns True (cancel), the instance fires DocumentCloseCanceled and does not close the document.

  • 如果所有处理程序都返回False (不取消),实例将触发BeforeDocumentClose ,然后关闭该文档。If all handlers return False (don't cancel), the instance fires BeforeDocumentClose and then closes the document.

Visio 实例在触发查询或取消事件时,会响应来自客户端代码的查询,但拒绝执行操作。客户端代码可以在响应查询或取消事件时显示窗体或消息框。While a Visio instance is firing a query or cancel event, it responds to inquiries from client code but refuses to perform operations. Client code can show forms or message boxes while responding to a query or cancel event.

如果您使用 Microsoft Visual Basic 或 Visual Basic for Applications (VBA),则此主题中的语法描述的是一种通用而有效的事件处理方法。If you're using Microsoft Visual Basic or Visual Basic for Applications (VBA), the syntax in this topic describes a common, efficient way to handle events.

如果您想要创建您自己的事件对象,使用添加AddAdvise方法。若要创建一个事件对象,运行加载项,请使用Add方法,应用到事件列表集合。若要创建一个事件对象,该对象接收通知,请使用AddAdvise方法。若要查找您想要创建的事件的事件代码,请参阅事件代码If you want to create your own Event objects, use the Add or AddAdvise method. To create an Event object that runs an add-on, use the Add method as it applies to the EventList collection. To create an Event object that receives notification, use the AddAdvise method. To find an event code for the event you want to create, seeEvent codes.

© 2018 Microsoft