API Documentation > CorelDRAW > 2025-v26 > Document > IVGDocument
Document.Dirty property
Returns or specifies whether a document has been modified since it was last saved
Syntax:
Property Get Dirty() As Boolean
Property Let Dirty(ByVal Value As Boolean)
Remarks:
The Dirty property returns or specifies a value that determines whether the document was modified after it was last saved.
Examples:
The following VBA example asks the user to save the document if the changes have not been saved, and then closes the document.
Sub Test()
If ActiveDocument.Dirty Then
  If MsgBox("Document is modified. Save?", vbOKCancel) = vbCancel Then Exit Sub

 ActiveDocument.Save
  End If
  ActiveDocument.Close

End Sub