Macro to send email to a specific address [closed]
I have this: dispatcher.executeDispatch(document, ".uno:SendMailDocAsPDF", "", 0, Array())
But I want to send email to an address (hard-coded), like this: myemail@mydomain.com
Here's the whole macro I have now:
sub Send_As_PDF
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:SendMailDocAsPDF", "", 0, Array())
end sub
(Edited for better readability; Lupp)
I am afraid you won't get anywhere with this topic based on a recorded macro.
Did you already study 13.15.4 of "The Book" by Andrew Pitonyak, mainly the final Sub of the listing there? The book is availablel from this webpage. Also visit this page.
The MailMessage should also have a .Body property.
I try to start with a recorded macro because I don't know about the object model. Often I can edit and tailor it to my needs afterward. But the book will be a huge help! Thanks very much.