I am trying to develop an add-in to catch and stop file deletions within PDM Professional so can be handled in accordance with our policies.
I have been successful in catching the predelete with:
and in the OnCmd section stopping the operation with:
"poCmd.mbCancel = True"
But I still get a warning box or error.
"Error deleting File. Cause: The operation was not permitted by one of the installed add-ins."
I have tried including in a Try statement ending with catches:
poCmd.mbCancel = True
Catch ex As Runtime.InteropServices.COMException
Select Case ex.ErrorCode
MessageBox.Show("HRESULT = 0x" +
ex.ErrorCode.ToString("X") + vbCrLf +
Catch ex As Exception
but this don't seem to catch.
Any help would be appreciated