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_DocumentBeforeSaveEventHandler Delegate 

A Delegate type used to add an event handler for the DocumentBeforeSave event. The DocumentBeforeSave event occurs before any open document is saved.

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

Sub Sub1(Doc As Document, _
	SaveAsUI As Boolean, _
	Cancel As Boolean)
End Sub
Dim applicationEvents4_DocumentBeforeSaveEventHandler1 As New ApplicationEvents4_DocumentBeforeSaveEventHandler(AddressOf Sub1)

public delegate void ApplicationEvents4_DocumentBeforeSaveEventHandler(
	[In] Document Doc, 
	[In] ref bool SaveAsUI, 
	[In, Out] ref bool Cancel
public delegate void ApplicationEvents4_DocumentBeforeSaveEventHandler(
	/*in*/Document Doc, 
	/*in*/boolean SaveAsUI, 
	/*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 saved.


True to display the Save As dialog box.


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

Development Platforms

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

Target Platforms

Community Additions