Apache OpenOffice (AOO) Bugzilla – Issue 5309
Load template with script makes saving fail
Last modified: 2013-02-24 21:10:01 UTC
Win2000, OO 1.0, Writer, StarBasic I load and process writer-template with Star-Basic like this: Dim mArgs() oDocument = oDesktop.loadComponentFromURL ("file:///"+sPath+sFileName+“.stw“, "_blank", 0, mArgs) oDocument.lockControllers() oReplace = oDocument.createReplaceDescriptor ... ' Doing some replaces oDocument.storeAsURL(sUrl, mFileProperties()) oDocument.unlockControllers() The saving works here without problems. The document is not closed, because sometimes the user want to chang something manually and then saves the document manually with File->Save. And HERE you get a "generall I/O-error while saving [sUrl]". The filename is just a 6-digit-number (like "000123.sxw") I tried to do a manual File->Save as... (for example "000123_2.sxw"), but then OO gives the same error and says it could not save "000123.swx" (!) (but I wrote "000123_2.sxw" in the file-dialog-box...). This is all very strange and it happens only when opening the template with loadComponentFromURL. It could not be an error of Win2000, because when opening the same document manually with File->Open, it all works fine. I used the same script in StarOffice 6.0 Beta and it worked, too.
The problem was caused by an statement in my code: mFileProperties(0).Value = FALSE When not using this statement, everything works fine.
closing