The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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

Sub Sub1(Doc As Document, _
	Cancel As Boolean)
End Sub
Dim applicationEvents4_DocumentBeforeCloseEventHandler1 As New ApplicationEvents4_DocumentBeforeCloseEventHandler(AddressOf Sub1)

public delegate void ApplicationEvents4_DocumentBeforeCloseEventHandler(
	[In] Document Doc, 
	[In, Out] ref bool Cancel
public delegate void ApplicationEvents4_DocumentBeforeCloseEventHandler(
	/*in*/Document Doc, 
	/*in*/boolean Cancel
In JScript, you can use the delegates in the .NET Framework, but you cannot define your own.



The document that's being closed.


False when the event occurs. If the event procedure sets this argument to True, the document doesn't close when the procedure is finished.

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

Community Additions