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