Apache OpenOffice (AOO) Bugzilla – Issue 97823
StoreToUrl error 1001 automation bridge when saving document
Last modified: 2017-05-20 10:01:58 UTC
Code which worked in all previous OO 2.3 and earlier versions now fails in OO 3.0.0 Build 9358. The code fails in both VB and Foxpro. Can create a document through code and save OK. However if an existing document is opened (either a Writer document or Calc) and it is modified and then saved - you get the error - OLE I Dsipatch exception code 1001 from [automation bridge] com.sun.star.task.ErrorCodeIOException: .. Here is the code in VB - Try oDesk = oSM.CreateInstance("com.sun.star.frame.Desktop") Catch ex As Exception Throw New Exception("Could not create OpenOffice service" & vbCrLf & ex.ToString()) End Try 'Set the parameters for opening the file Dim OpenParams(1) OpenParams(0) = OOoPropertyValue(oSM, "Hidden", True) OpenParams(1) = OOoPropertyValue(oSM, "OverWrite", True) 'Document name Dim cURL cURL = "file://///Fw1/homedrives/dswift/My Documents/Work Folder/Word Processing/Filing/Test Letter.odt" Try oDoc = oDesk.loadcomponentFromURL(cURL, "_blank", 0, OpenParams) Catch ex As Exception Throw New Exception("Could not open " & cURL & vbCrLf & ex.ToString()) End Try 'Write back the Title, Keyword and Comments oDoc.DocumentInfo.Title = "The Title" oDoc.DocumentInfo.Keywords = "The keyword" oDoc.DocumentInfo.Description = "The Description" 'Set the parameters for saving the file Dim SaveParams(1) SaveParams(0) = OOoPropertyValue(oSM, "Hidden", True) SaveParams(1) = OOoPropertyValue(oSM, "OverWrite", True) oDoc.storeToUrl(cURL, SaveParams) '---------------------This line fails with error code 1001 oDoc.close(True) oDoc = Nothing Public Function OOoPropertyValue(ByRef objServiceMgr As Object, ByVal cName As Object, ByVal uValue As Object) As Object Dim oPropertyValue As Object ' not sure where I found this, but it does the trick! oPropertyValue = objServiceMgr.Bridge_GetStruct ("com.sun.star.beans.PropertyValue") oPropertyValue.Name = cName oPropertyValue.Value = uValue Return oPropertyValue End Function
@ jsk: Something for you?
Assign to new default-assignee
(In reply to comment #2) > Assign to new default-assignee To fma. I am using OO 3.0.0 and VB5 and have this problem. I am not sure which parts of the code below to use and some of it is not recognised. Can you give me some assistance? From snookered
Please attach example.
No info from author.