How to call DocMerge from a Hook ?

Hi guys,

does one of you already try to call DocMerge from a Hook (or similar code context) ?

Of course I know it can be done through BPM ; but what we want to do can be trigger and handle using BPM.

Also, I would like to see if error handling is better with code generation.

Best regards,

Fred