vor ein paar Jahren hatten mir ein paar Forumsmitglieder ein tolles Makros zusammen gebastelt welches mir erlaubte ein PDF aus dem Calc Dokument zu erstellen und dieses dann direkt als Email mit allem drum und dran zu versenden.
Nun möchte ich gerne ein weiteres PDF hinzufügen welches immer mit gesendet werden soll.
Den ersten Pfad Namen mit einen Semikolon oder Komma und dem zweiten Pfad dran zu hängen hat nicht funktioniert (file:///c:/....1.pdf; file:///c:/....2.pdf).
Hoffe mir kann jemand helfen.
Hier der Mailversand Code
Code: Alles auswählen
Sub SendMail 'this is solution for button
doc = thisComponent
list = doc.getCurrentController.getActiveSheet
mailadress = list.GetCellRangeByName("B8").string
subject = list.GetCellRangeByName("A23").string
bodytext = list.GetCellRangeByName("A24").string
attachmentlink = list.GetCellRangeByName("G7").string
Mailer (mailadress, subject, bodytext, attachmentlink)
end sub
Sub HyperSendMail (sURL$) 'this is solution for function HYPERLINK in the sheet
mailadress = getArgumentFromURL(sURL,"MailAddress")
subject = getArgumentFromURL(sURL, "Subject")
bodytext = getArgumentFromURL(sURL, "Body")
attachmentlink = getArgumentFromURL(sURL, "Attach")
Mailer (mailadress, subject, bodytext, attachmentlink)
End Sub
Sub Mailer (eMailAddress as String, eSubject as String, eBody as String, Attachment as String)
Dim eMailer as Object
Dim eMailClient as Object
Dim eMessage as Object
Dim nFlag as integer
nFlag = 0
eMailer = createUnoService( "com.sun.star.system.SimpleSystemMail" )
eMailClient = eMailer.querySimpleMailClient()
eMessage = eMailClient.createSimpleMailMessage()
eMessage.setRecipient(eMailAddress)
eMessage.setSubject(eSubject)
if Attachment <> "" Then
eAttachmentURL = convertToUrl(Attachment)
eMessage.setAttachement (Array(eAttachmentURL))
end if
eBody = Replace(eBody,"*",chr(10))
eMessage.body = eBody
eMailClient.sendSimpleMailMessage( eMessage, nFlag)
End Sub