I have the macro codes below and hoping to remove user interaction when sending the email.
Same codes except for the UNO function is used with Windows 7 and it works fine, email is being sent without confirmation. Currently using Fedora and Thunderbird.
Sub SendProdL()
thisComponent.store()
If MsgBox ("Are you sure you want to send your Productivity Report?", 292, "WARNING") = 6 Then
Dim x as string
Dim y as string
x = ThisComponent.geturl()
Document = ThisComponent
Sheets = Document.Sheets
summarysh = Sheets.getByName("My Summary")
Subj = summarysh.getCellByPosition(2,3).string
StaffName = summarysh.getCellByPosition(8,5).string
PDate = summarysh.getCellByPosition(4,7).String
Dim vMailSystem as Object
Dim vMail as Object
Dim vMessage
y = inputbox ("Enter Additional Recipients:","Unified Productivity Tracker")
vMailSystem = createUnoService( "com.sun.star.system.SimpleCommandMail" )
vMail = vMailSystem.querySimpleMailClient()
vMessage = vMail.createSimpleMailMessage()
vMessage.setRecipient("unifi**@tpg.com.au")
If y <> "" Then
vMessage.ccRecipient = Array(y, ",")
End If
'vMessage.bccRecipient = Array(y, ",")
vMessage.setSubject("[AUTO]: DAILY PRODUCTIVITY REPORT - " + StaffName + " - " + PDate)
Dim vAttach(0)
vAttach(0) = x
vMessage.setAttachement(vAttach())
'DEFAULTS Launch the currently configured system mail client.
'NO_USER_INTERFACE Do not show the interface, just do it!
'NO_LOGON_DIALOG No logon dialog but will throw an exception if one
' is required.
i = com.sun.star.system.SimpleMailClientFlags.NO_USER_INTERFACE
vMail.sendSimpleMailMessage(vMessage, i)
Else
Exit Sub
End If
End Sub