Using Windows 11, 64 bits, 16MB, LO 7.3.5.2 (database Firebird external)
To send an email-message from LibreOffice Base I found a macro to be used.
For this purpose I have installed Thunderbird, since I normally use web-based Email
Everything works very well, including using one attachment, but I would like send multiple files to one or more recipients. I cannot get this to work.
The concerned macro coding is:
Sub SendEmail
Dim eMailer as Object
Dim eMailClient as Object
Dim eMessage as Object
Dim sOnderwerp as String
Dim sBody as String
sFormName = Split(thiscomponent.Title," : ")(1)
oForm = thisComponent.drawpage.forms.getByName(sFormName)
eMailer = createUnoService (“com.sun.star.system.SimpleSystemMail”)
eMailClient = eMailer.querySimpleMailClient()
eMessage = eMailClient.createSimpleMailMessage()
sOnderwerp = oForm.getByName(“F_Onderwerp”).text
sBody = oForm.getByName(“F_Bericht”).text
eMessage.Body = sBody
eMessage.SetRecipient(sEmailAdres)
eMessage.setSubject(sOnderwerp)
eMessage.setAttachement(Array(sFieldName1))
eMailClient.sendSimpleMailMessage(eMessage,
com.sun.star.system.SimpleMailClientFlags.NO_USER_INTERFACE)
End Sub
The Recipient global field sEmailAdres contains the recipient(s), separated by commas
The Attachment global field sFieldname1 contains the filename to attach, converted to URL
Question is: Is it possible to send multiple attachments anyway, and, if yes, how to populate the attachment field to attach multiple files ?