Hi there,
Maybe I haven't searched enough in the database of this forum, but my problem is that I am looking for a simple macro script to send an email to 2 different email addresses from calc (see the attachment) .
My email client is Microsoft Outlook. My OpenOffice version is 4.1.3.
I must be able to put the subject in the email. That's all but I am an so called aliën in OpenOffice.
Can someone help me with this , please?
Sending an email from Calc with a macro
Sending an email from Calc with a macro
- Attachments
-
- DAGREGISTRATIE SNEL SCHOON ZUID-OOST NIEUWE STIJL 2.0.ods
- I am from the Netherlands so that's why the language in this spreadsheet is probably strange for you
- (16 KiB) Downloaded 219 times
OpenOffice 4.13 and Operating system: Windows 10
Email Client: Outlook
Email Client: Outlook
Re: sending an email from calc with a macro
This works for me
Code: Select all
Sub SendEmail
eMailAddress = "dummy1@gmail.com; dummy2@gmail.com"
eSubject = "Test Message"
eMailer = createUnoService("com.sun.star.system.SystemMailProvider")
eMailClient = eMailer.queryMailClient()
eMessage = eMailClient.createMailMessage()
eMessage.Recipient = eMailAddress
eMessage.Subject = eSubject
eMessage.Body = "The text in the message"
AttachmentURL = convertToUrl("c:\users\fjcc\desktop\99Export.txt")
eMessage.Attachement = array(AttachmentURL)
eMailClient.sendMailMessage ( eMessage, com.sun.star.system.MailClientFlags.NO_USER_INTERFACE )
End Sub
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Re: sending an email from calc with a macro
or when you want to control the mail client manually:Code: Select all
eMailClient.sendMailMessage ( eMessage, com.sun.star.system.MailClientFlags.NO_USER_INTERFACE )
Code: Select all
eMailClient.sendSimpleMailMessage( eMessage, 0 )
Try the ThunderBird e-mail client. It works well for me with similar macro codes.My email client is Microsoft Outlook.
(And it worked with the old OutlookExpress. I never used the MS Outlook...)
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.