Macro to send email to a specific address

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.

Hello dear fellow LibreOffice User,
i don’t know if it still matters at this time, but you could write:

Sub Send_As_PDF()
	Dim oFrame, oDispatch
	Dim aProps() As New com.sun.star.beans.PropertyValue
	AppendProperty( aProps(), "Recipient", "myemail@mydomain.com" )
	oFrame = ThisComponent.CurrentController.Frame
	oDispatch = createUnoService( "com.sun.star.frame.DispatchHelper" )
	oDispatch.executeDispatch( oFrame, ".uno:SendMailDocAsPDF", "", 0, aProps() )
End Sub

Sub AppendProperty( oProps(), sName As String, ByVal oValue )
	Dim oProperty As New com.sun.star.beans.PropertyValue
	Dim iLB As Integer, iUB As Integer
	oProperty.Name = sName
	oProperty.Value = oValue
	iLB = LBound( oProps() )
	iUB = UBound( oProps() ) + 1
	ReDim Preserve oProps( iLB To iUB )
	oProps(iUB) = oProperty
End Sub