DocumentBase.CloseEvent 事件
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在关闭文档时发生。
public event Microsoft.Office.Interop.Word.DocumentEvents2_CloseEventHandler CloseEvent;
事件类型
示例
下面的代码示例在文档关闭时显示一条消息。 若要使用此示例,请在 ThisDocument 文档级项目的类中运行它。
private void DocumentCloseEvent()
{
this.CloseEvent += new Microsoft.Office.Interop.Word.DocumentEvents2_CloseEventHandler(ThisDocument_CloseEvent);
}
void ThisDocument_CloseEvent()
{
MessageBox.Show("The document is closing.");
}
Private Sub DocumentCloseEvent()
AddHandler Me.CloseEvent, AddressOf ThisDocument_CloseEvent
End Sub
Sub ThisDocument_CloseEvent()
MessageBox.Show("The document is closing.")
End Sub