Apache OpenOffice (AOO) Bugzilla – Issue 113120
macro with mailmerge & PDF attachment
Last modified: 2017-05-20 11:27:50 UTC
I'm working with OOo 3.2.0 on ubuntu 10.04 and mysql 5.1.41 I have a macro with the following code: Sub serienbrief_pdf Dim MailMerge as Object Dim DocumentURL as String Dim bodytext as String bodytext = "Hallo," & Chr(13) & Chr(13) & "blah" MailMerge = createunoservice("com.sun.star.text.MailMerge") Mailmerge.DataSourceName = "db-cn-mysql" MailMerge.CommandType = com.sun.star.sdb.CommandType.QUERY MailMerge.Command = "my query" MailMerge.DocumentURL = ConvertToUrl("/path_to_doc/mydoc.ott") MailMerge.OutputType = 3 MailMerge.Subject = "my subject" MailMerge.MailBody=bodytext MailMerge.AddressFromColumn = "email" MailMerge.SendAsAttachment = 1 MailMerge.AttachmentName = "file.pdf" MailMerge.AttachmentFilter = "writer_pdf_Export" MailMerge.execute(Array()) MailMerge.Dispose() End Sub By executing, I do have a quite different behaviour each time. All seems to work fine, except the creation of the PDF file. It seem, that the files got send before the creation is finished. Sometimes only the bold text is in the attachment, sometimes only the normal formatted text, sometimes no text, sometimes all text. The missing text in the PDF file is invisible, I can mark it, copy and paste it to an editor. It seems, the Text is behind the page. If I use the GUI to mailmerge with the same options, it is working without any problems.
Olli, please have a look.
Reset assigne to the default "issues@openoffice.apache.org".