I think I have enough info now to make it work, but what is the difference between DocumentActived and DocumentBecameCurrent?
'Active' and 'Current' are two different things.
Active means that the document's window is Active.
Current means that a document's thread is running.
Both are exclusive (only one document can be active,
and only one document's thread can be running at any
given time).
What's important is that the 'Current' document is not necessarily
the 'Active' document (although that's commonly the case).
A document can temporarily be made the 'current' document without
also being activated, which is necessary in order for changes to the
associated database to be updated on the display.
You shouldn't rely on any events signaling that a document has
or will become the current document, since they don't mean that
the document is or will become the active document.