You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openoffice.apache.org by bu...@apache.org on 2018/03/07 05:06:02 UTC
[Issue 127726] New: MailMerge - "Failed to savetemporary file"
exception
https://bz.apache.org/ooo/show_bug.cgi?id=127726
Issue ID: 127726
Issue Type: DEFECT
Summary: MailMerge - "Failed to savetemporary file" exception
Product: App Dev
Version: 4.1.5
Hardware: PC
OS: All
Status: UNCONFIRMED
Severity: Critical
Priority: P5 (lowest)
Component: scripting
Assignee: issues@openoffice.apache.org
Reporter: ppancada@gmail.com
Target Milestone: ---
Created attachment 86361
--> https://bz.apache.org/ooo/attachment.cgi?id=86361&action=edit
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
--
You are receiving this mail because:
You are the assignee for the issue.
[Issue 127726] MailMerge - "Failed to savetemporary file" exception
Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=127726
Pedro Fonseca <pp...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |automation_bug
--
You are receiving this mail because:
You are the assignee for the issue.
[Issue 127726] MailMerge - "Failed to savetemporary file" exception
Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=127726
Keith N. McKenna <kn...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |knmc@apache.org
Status|RESOLVED |CLOSED
--- Comment #2 from Keith N. McKenna <kn...@apache.org> ---
Closed
--
You are receiving this mail because:
You are the assignee for the issue.
[Issue 127726] MailMerge - "Failed to savetemporary file" exception
Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=127726
Pedro Fonseca <pp...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |NOT_AN_OOO_ISSUE
--- Comment #1 from Pedro Fonseca <pp...@gmail.com> ---
PLEASE NOTE - This only happens with LibreOffice 6.0 not with OpenOffice. With
OpenOffice the Merge.execute() command works perfectly!
Cheers,
Pedro
--
You are receiving this mail because:
You are the assignee for the issue.