In the The current document - Working with Documents - LibreOffice BASIC Programming Guide - The Document Foundation Wiki section:
You should instead use Basic object ThisComponent. It returns the document object on which the macro is run. If you start the macro from the IDE, ThisComponent will still find and return your document.
The emphasized portion makes little sense to me as it does not elaborate on where the document object comes from.
IMHO this section should probably be merged into ThisComponent - The StarDesktop - Working with Documents - LibreOffice BASIC Programming Guide - The Document Foundation Wiki, which gives the rather proper explanation:
ThisComponent returns the last previously active document.