Not without macro code, but this will give you a hint:
oField = oForm.getByName("GraphicalControl")
oField2 = oForm.getByName("FileName")
stName = oField2.Text
IF stName = "" THEN
stName = "Imagefile"
END IF
oStream = oField.BoundField.getBinaryStream
oPath = createUnoService("com.sun.star.util.PathSettings")
stPath = oPath.Temp & "/" & stName
oSimpleFileAccess = createUnoService("com.sun.star.ucb.SimpleFileAccess")
oSimpleFileAccess.writeFile(stPath, oStream)
Code is started form a form. There are two fields, one shows the internal image, the other shows the name of the file. With getBinaryStream
the image is read from the database, with write file
the image is written to the temporary folder.
Now the part to send this image:
DIM arAttach(0)
DIM arCC(0)
DIM arBCC(0)
arAttach(0) = stPath
IF GetGuiType() = 1 THEN
oMailer = createUnoService("com.sun.star.system.SimpleSystemMail")
' if not: Linux/Mac
ELSE
oMailer = createUnoService("com.sun.star.system.SimpleCommandMail")
END IF
oMailProgram = oMailer.querySimpleMailClient()
oNewMessage = oMailProgram.createSimpleMailMessage()
oNewMessage.Recipient = stMail
oNewMessage.CcRecipient = arCC()
oNewMessage.BccRecipient = arBCC()
oNewMessage.Subject = stSubject
oNewMessage.Body = stBody
oNewMessage.setAttachement(arAttach())
oMailProgram.sendSimpleMailMessage(oNewMessage, 0 )
If you put this together you will extract the file and set is as attachment to your local connected mail program. You have to define in Tools → Options → Internet → EMail your EMail program.
Will also be possible to insert this image into a Calc file, save this file to pdf and create the attachment for the mail this way …