The DocEnd macro is triggered by closing the current document (project), either...
...triggers execution of the DocEnd macro.
... triggers execution of the DocEnd macro.
The DocEnd macro is unique in that a define statement for the DocEnd macro is contained in the file MACROS.CNF (found in the Origin software folder). MACROS.CNF is read when Origin starts. The definition for DocEnd (the default definition does nothing) can be commented out or modified as desired.