Anteckning
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
Occurs when the document is opened.
Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)
Syntax
'Declaration
Public Event Open As DocumentEvents2_OpenEventHandler
public event DocumentEvents2_OpenEventHandler Open
Examples
The following code example displays a message when the document opens. To use this example, run it from the ThisDocument class in a document-level project.
Private Sub DocumentOpen()
AddHandler Me.Open, AddressOf ThisDocument_Open
End Sub
Private Sub ThisDocument_Open()
MessageBox.Show("The document has opened.")
End Sub
private void DocumentOpen()
{
this.Open += new Microsoft.Office.Interop.Word.DocumentEvents2_OpenEventHandler(ThisDocument_Open);
}
void ThisDocument_Open()
{
MessageBox.Show("The document has opened.");
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.