This documentation is archived and is not being maintained.

Application.DocumentOpen Event

Office 2007
Occurs when opening a document.

Syntax

expression.DocumentOpen(Doc)

expression   A variable that represents an Application object.

Parameters

NameRequired/OptionalData TypeDescription
DocRequiredDocumentThe document that's being opened.

Example

This example displays a message with the document's name when opening a document.

Visual Basic for Applications
Private Sub appPub_DocumentOpen(ByVal Doc As Document)
    MsgBox "Please wait. " & Doc.Name & " is opening."
End Sub



Show: