I am running LibraOffice on a Raspberry Pi 4b using the Twister OS. I captured the following Macros in Libra Basic using the Record function:
Code: Select all
sub SEmailooc
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:SendMailDocAsOOo", "", 0, Array())
end sub
sub SEmailpdf
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:SendMail", "", 0, Array())
end sub
This code works perfectly with the OO Email Preferences set to use the default Twister OS Email Client App (I think it is called "Mail Reader"). SEmailooc was recorded while selecting the Send E-mail of the OpenOffice Calc Spreadsheet that I was working on. As you can see, the parameters used to specify the recipients email address and Subject line are not shown in the recorded macro.
The second macro, Emailpdf, used the Send E-mail Document selection, that also allowed me to select a document where I had to browse the File system and select the file I wanted to added to the Email. As you can see again, the parameters used to specify the recipients email address, Subject line and path to the added file are not shown in the recorded macro.
Those Email Element are probably specified in the Array() variable seen on the code line:
dispatcher.executeDispatch(document, ".uno:SendMail", "", 0, Array())
Can anyone tell me how to setup that Array() to include the Recipient Email Address, Subject line, body text, and url path to the document I selected to include in the email? It appears that the ".uno:SendMailDocAsOOo" and ".uno:SendMail" use the Default Mail Client sender name and password credentials to send properly through gmail.
This is the first time in years that emailing directly out of an OpenOffice/LibraOffice Calc document has worked for me without security/Mail Server Link ERROR issues.
OpenOffice 4.1.14 on Mac Catalina(10.15.7), RasPi4B (TwisterOS-8/2023update) & MS Wnds10