I have a special framework with pascal-similar language.
I'm trying to export some data to OpenOffice Calc.
Code: Select all
var App, Instance, Document, Sheet, Cell : variant;
App := CreateOLEObject('com.sun.star.ServiceManager');
Instance := App.createInstance('com.sun.star.frame.Desktop');
Document := Instance.loadComponentFromURL('private:factory/scalc', '_blank', 0, args);
Sheet := Document.createInstance('com.sun.star.sheet.Spreadsheet');
Document.Sheets.insertByName('MySheet', Sheet);
Cell := Sheet.getCellbyPosition(2, 3);
Cell.String := 'Test Text';
Now I want to justify text in the cell to the right.
Formatting Spreadsheet Documents:
How can I do it?Special cell formatting is handled by the com.sun.star.table.CellProperties service.
HoriJustify (enum): horizontal justification of the text (value from com.sun.star.table.CellHoriJustify)
Cell.CellProperties? OLE Object doesn't have method CellProperties
Cell.createInstance('com.sun.star.table.CellProperties')? OLE Object doesn't have method...
App.createInstance('com.sun.star.table.CellProperties')? Unsupported type of returned value.
Is the latter way correct? Probably the problem is in my framework.
Thanks.