I had planned on documenting how to do this some years back and AndrewBase.odt, and my only notes say that I should document the new e-mail merge API released in OpenOffice.org version 2.01; that was a long time ago. I generally do not have reason to use mailmerge, but did you want to send something by email or to print? Someone posted a question about using mail merge with UNO in Basic here: https://ask.libreoffice.org/t/syntax-for-using-spreadsheet-as-data-source-in-emailmerge-macro/24831