Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | MailMerge - "Failed to savetemporary file" exception | ||||||
---|---|---|---|---|---|---|---|
Product: | App Dev | Reporter: | Pedro Fonseca <ppancada> | ||||
Component: | scripting | Assignee: | AOO issues mailing list <issues> | ||||
Status: | CLOSED NOT_AN_OOO_ISSUE | QA Contact: | |||||
Severity: | Critical | ||||||
Priority: | P5 (lowest) | CC: | knmc | ||||
Version: | 4.1.5 | Keywords: | automation_bug | ||||
Target Milestone: | --- | ||||||
Hardware: | PC | ||||||
OS: | All | ||||||
Issue Type: | DEFECT | Latest Confirmation in: | --- | ||||
Developer Difficulty: | --- | ||||||
Attachments: |
|
PLEASE NOTE - This only happens with LibreOffice 6.0 not with OpenOffice. With OpenOffice the Merge.execute() command works perfectly! Cheers, Pedro Closed |
Created attachment 86361 [details] Error message as shown in script editor When running a MailMerge command using a Basic script such as this I most times get the 'Failed to savetemporary file' error/exception on the .execute() call: sub teste doMerge "MERGES", "D:\pedro\Avetmiss\3.0\server-install\deploy\TemplatesOL\DataSource\MERGES.odb", "LETTER", "file:///D:/pedro/Avetmiss/3.0/server-install/deploy/TemplatesOL/Letter/letter_template.odt" end sub Sub doMerge(dbAlias as string, dbPath as String, table as String, template as string) Dim mm as Object dim conn as Object dim oDC as Object template = ConvertToURL(template) oDC = createUnoService("com.sun.star.sdb.DatabaseContext") if (not oDC.hasRegisteredDatabase(dbAlias)) then oDC.registerDatabaseLocation(dbAlias, ConvertToURL(dbPath)) if (not oDC.hasRegisteredDatabase(dbAlias)) then MsgBox("Datasource '" & dbAlias & "' is nod defined.") exit sub end if end if mm = CreateUnoService("com.sun.star.text.MailMerge") Dim mergedDoc With mm .DocumentURL = template .DataSourceName = dbAlias .Command = table .CommandType = 0 .OutputType = 2 ' 1=printer 2=file .OutputUrl = "file:///C:/temp/" 'Having selected output to file we choose the url of the result files .FileNamePrefix = dbAlias & "_" .SaveFilter = "writer_pdf_Export" ' use this to get an ODT instead: "writer8" '.SaveFilter = "writer8" ' .SaveAsSingleFile = True mergedDoc = .OutputUrl & .FileNamePrefix & "0.pdf" If FileExists(mergedDoc) Then Kill(mergedDoc) end if if (.execute(Array())) then 'use this to open with OpenOffice 'StarDesktop.loadComponentFromURL(mergedDoc, "_blank", 0, Array()) Dim oSvc as object oSvc = createUnoService("com.sun.star.system.SystemShellExecute") oSvc.execute(mergedDoc, "", 0) end if .dispose() end with End Sub Please not I have run this from a Delphi project too (using COM automation) and have exactly the same error. All paths exist and are valid and I noticed it uses the environmnet %temp% directory to write some temp files and this seems to be the issue. Would love to see this fixed... Cheers, Pedro