Event that is fired whenever a document is closed.
Name | Type | Description |
DocumentObject | Document | The Document object that is being closed. The document being closed is provided for both the kBefore and kAfter cases. This is because the Document is still available after it's closed, although in a limited sense, until it is terminated. One of the useful things you can do with a document in this state is to compare it's identity with a reference previously saved (usually during kBefore). For example: Private m_oClosingDoc As Object Private Sub oAppEvents_OnClose(ByVal DocumentObject As Document, ..., ByVal BeforeOrAfter As EventTimingEnum, ...) If BeforeOrAfter = kBefore Then ' Check to see if the Document being closed is an interesting one. If Interesting(DocumentObject) Then ' Save a reference to the object. Set m_oClosingDoc = DocumentObject End If Else ' Now we're either after the close or it's been aborted. Check to see if the document is the interesting one. If DocumentObject Is m_oClosingDoc Then If BeforeOrAfter = kAfter then ' The document was closed. ElseIf BeforeOrAfter = kAbort Then ' The close was aborted. End If End If End Sub |
FullDocumentName | String | Output string that specifies the fully qualified name of the document being closed. This is supplied both before and after. |
BeforeOrAfter | EventTimingEnum | Input indicating if the event is being fired before (kBefore) or after (kAfter) the document is closed. Notification is sent before and after the document is closed. In the case where this event is canceled the value of this argument will be kAbort. |
Context | NameValueMap | Input object that can be used to determine the context of why the event fired. This event provides additional information through the Context argument as described below: Name = "HealthStatusEnum", Value = The health status of the document. If this value is anything other than kUpToDateHealth you know the Document object returned is not in a state where you can use most of its methods or properties. |
HandlingCode | HandlingCodeEnum | This event supports the ability to cancel the close. By setting this argument to kEventCanceled when the BeforeOrAfter argument is kBefore Inventor will abort the close. When the close is cancelled, this event is fired again but the BeforeOrAfter argument will have a value of kAbort. |