ApplicationEvents4_DocumentBeforeCloseEventHandler Delegate

A Delegate type used to add an event handler for the DocumentBeforeClose event. The DocumentBeforeClose event occurs immediately before any open document closes.

Namespace:  Microsoft.Office.Interop.Word
Assembly:  Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)


<ComVisibleAttribute(False)> _
Public Delegate Sub ApplicationEvents4_DocumentBeforeCloseEventHandler ( _
    Doc As Document, _
    <OutAttribute> ByRef Cancel As Boolean _
Dim instance As New ApplicationEvents4_DocumentBeforeCloseEventHandler(AddressOf HandlerMethod)
public delegate void ApplicationEvents4_DocumentBeforeCloseEventHandler(
    Document Doc,
    out bool Cancel


  • Cancel
    Type: System.Boolean%
    False when the event occurs. If the event procedure sets this argument to True, the document doesn't close when the procedure is finished.

See Also


Microsoft.Office.Interop.Word Namespace