StoreAsURL IOException after GraphicObjectShape add

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
japozo
Posts: 1
Joined: Thu Jun 02, 2016 12:37 pm

StoreAsURL IOException after GraphicObjectShape add

Post by japozo »

Hi all. I am using OpenOffice Base 3.2 under Ubuntu 10.04. Inside a Basic macro of Base I open Calc and I add a jpg file with GraphicObjectShape. I am getting an ErrorCodeIOException (message: .) from StoreAsURL only after call to ADD of the object GraphicObjectShape. This is the code that I use:

Code: Select all

...
'Opening Calc		
oPath = CreateUnoService( "com.sun.star.util.PathSettings" ) 
oDocument = StarDesktop.LoadComponentFromURL("private:factory/scalc", "_blank", 0, oArgs())
...
'Here I save the spreadsheet without problems
oDocument.StoreAsURL(oPath.Work+"/sample.ods", oArgs())
...
'Inserting jpg file in spreadsheet
oLogo = ThisComponent.CreateInstance("com.sun.star.drawing.GraphicObjectShape")
oLogo.GraphicURL = convertToURL("\\SAB-SERV-001\Base de datos\Plantillas\Logo\Logo FLM rojo.jpg")
oSize = oLogo.Size
oSize.Height = 607
oSize.Width = 3757
oLogo.Size = oSize
oPos = oLogo.Position
oPos.X = 1
oPos.Y = 1
oLogo.Position = oPos
oHojaParaLogo = oDocument.DrawPages.getByIndex(0)
oHojaParaLogo.Add(oLogo)		
'Just after last intruction (add) I have the exception If I make
oDocument.StoreAsURL(oPath.Work+"/sample1.ods", oArgs())
Please, help me!! Thank you in advance.
OpenOffice 3.2 on Ubuntu 10.04 lucid (kernel 2.6.32-45-generic-pae)
Post Reply