I am trying to get LO Basic to print a document it creates at run-time. As far as I know, there is no way to do this with a document object, so I am searching for another approach.
Thanks to Dr. Google, I have found two ideas I am trying to stitch together. One is the com.sun.star.system.SystemShellExecute service and one is calling openoffice from the command line with the ‘-pt’ option. Here is wehre I have arrived so far:
Sub subThinkingAboutPrinting
Dim oSvc as Object
Dim strCommand As String
oSvc = createUnoService("com.sun.star.system.SystemShellExecute")
'openoffice -pt "PRINTER-NAME" FILENAME
strCommand = "/usr/bin/libreoffice -pt OfficeJet_6950 " & "/home/doug/ABPA/ABPAsoftware/MembershipAccounting/ABPA_Member_Payment_Receipt.odt"
oSvc.execute(strCommand, "", 0)
End Sub
This looks impressive and a solution to my problem. Unfortunately, it doesn’t work!
If anyone can suggest a workable method of printing document A via a macro in document B, I would be very grateful.
Kind regards,
Doug