Determine if Document is Dirty Example (VBA)
This example shows how to determine if a document is dirty and needs
to be saved.
'-----------------------------------------------
'
' Preconditions: SolidWorks document is open.
'
' Postconditions: None
'
'------------------------------------------------
Option Explicit
Sub main()
Dim
swApp As
SldWorks.SldWorks
Dim
swModel As
SldWorks.ModelDoc2
Set
swApp = Application.SldWorks
Set
swModel = swApp.GetFirstDocument
Do
While Not swModel Is Nothing
Debug.Print
swModel.GetPathName
Debug.Print
" "
& swModel.GetSaveFlag
Set
swModel = swModel.GetNext
Loop
End Sub