Message 1 of 2
OnInitializeDocument : HandlingCode doesn't work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all, in .net I would like to intercept the file creation on "OnInitializeDocument" event and undo operation (or confirm) in a certain conditions.
I set the "HandlingCode" parameters (HandlingCodeEnum.kEventCanceled or HandlingCodeEnum.kEventHandled) but in both cases it creates the file.
Anything else to set? What's wrong?
TIA
Alder
Private Sub m_appEvents_OnInitializeDocument(DocumentObject As _Document, FullDocumentName As String, BeforeOrAfter As EventTimingEnum, Context As NameValueMap, ByRef HandlingCode As HandlingCodeEnum) Handles m_appEvents.OnInitializeDocument
Try
...
If Cancel_Event then
HandlingCode = HandlingCodeEnum.kEventCanceled
Else
HandlingCode = HandlingCodeEnum.kEventHandled
End If
Catch ex As Exception
End Try
End Sub