BeginDocClose Event (ActiveX)

Triggered immediately after AutoCAD receives a request to close a drawing.

Supported platforms: Windows only

Signature

VBA:

object.BeginDocClose(Cancel)
object

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.

Cancel

Type: Boolean

Determines whether to prevent the drawing from being closed.

  • True: The drawing is prevented from closing.
  • False: The drawing is not prevented from closing.

Remarks

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.

Examples

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