Hello everyone,
My final objective:
I’d like to automate the process of selecting a range of cells, choosing “copy” command, and subsequently pasting it, as a table, into a body of a mail message. In my case it’s Thunderbird.
Here is what I’ve done so far:
-
I tried to avoid Thunderbird all together, by first trying to utilize SimpleSystemMail service. But the “body” argument only accepts string values.
-
Then I attempted to utilize services from com.sun.star.mail module. The “create” function from the MailMessage service accepts data in XTransferable structure, which is the same as XSystemClipboard. However, I cannot get the mail service to work (I simply do not know where am I going wrong). Would someone point me in the right direction, please? This is what I have gotten so far:
Sub testMail
Dim mailSP As Object: mailSP = createUnoService(“com.sun.star.mail.MailServiceProvider”)
Dim mailS As Object: mailS = mailSP.create(“com.sun.star.mail.MailServiceType.IMAP”)
Dim oAuth As Object: oAuth = createUnoService(“com.sun.star.mail.XAuthenticator”)
Dim oCurCont As Object: oCurCont = createUnoService(“com.sun.star.uno.XCurrentContext”)oCurCont.getValueByName(“ServerName”) = “imap.gmail.com” ← * this is where I’m getting stuck *
mailS.connect(oCurCont, oAuth)
End Sub
In all honesty, I don’t even know if I’m going the right way about any of this, but I’ve been searching information on similar topic, and cannot seem to find anything with a similar problem.
Thank you very much for any help and/or suggestions.