Triggered immediately after AutoCAD receives a request to close a drawing.
Supported platforms: Windows only
VBA:
object.BeginDocClose(Cancel)
Type: Document
An object expression that evaluates to a valid container object. In this case, the only valid containers are the application and a document.
Type: Boolean
Determines whether to prevent the drawing from being closed.
You can use this event to keep a drawing from being closed. This event should be used instead of the BeginClose event.
No events occur while a modal dialog is being displayed.
VBA:
Private Sub AcadDocument_BeginDocClose(Cancel As Boolean)
    ' This example prevents a drawing from closing.
    Cancel = True
    MsgBox "Please do not close this drawing."
End Sub
Visual LISP:
Not available