Can anybody help?
I vave the following code used in a VB.Net "Addin".
Private Sub m_applicationEvents_OnSaveDocument(ByVal DocumentObject As Inventor._Document, ByVal BeforeOrAfter As Inventor.EventTimingEnum, ByVal Context As Inventor.NameValueMap, ByRef HandlingCode As Inventor.HandlingCodeEnum) Handles m_applicationEvents.OnSaveDocument
REM EXIT THE SUB HERE IF THE "NO" BUTTON IS PRESSED!!!!
If BeforeOrAfter = EventTimingEnum.kAfter Then
Try
Dim invVBAProject As InventorVBAProject = m_inventorApplication.VBAProjects.Item(1)
Dim invModule As InventorVBAComponent = invVBAProject.InventorVBAComponents.Item("Module03")
Dim invSub As InventorVBAMember = invModule.InventorVBAMembers.Item("OnSave")
invSub.Execute()
Catch ex As Exception
End Try
End If
End Sub
I need to modify the above code so that if the "No" button is pressed (Please see the attached file) I exit the Sub Routine.
Does anybody know how to do this?
Many thanks in advance!!!!
Darren
Hi Darren,
If DocumentObject.Dirty Then ....
The document become dirty (True) on every modification, after save this property is False.
I suggest to verify this property after the follow line of your code:
If BeforeOrAfter = EventTimingEnum.kAfter Then
Bregs
Rossano Praderi