Page 1 of 1

OLE and OpenOffice

PostPosted: Wed Oct 22, 2008 11:44 pm
by driessen
Hello,

Can OLE also be used in FWH to connect to OpenOffice ?

If yes, how does it work ?

Thanks.

Re: OLE and OpenOffice

PostPosted: Thu Oct 23, 2008 7:22 am
by Enrico Maria Giordano
Code: Select all  Expand view
oSrvMan  = CREATEOBJECT( "com.sun.star.ServiceManager" )
oDesktop = oSrvMan:CreateInstance( "com.sun.star.frame.Desktop" )

oDoc = oDesktop:LoadComponentFromURL( "private:factory/scalc", "_blank", 0, {} )

oSheet = oDoc:GetSheets():GetByIndex( 0 )

oSheet:GetCellByPosition( 0, 0 ):SetString = "TEST"
oSheet:GetCellByPosition( 1, 0 ):SetValue = 123

oSheet:GetCellRangeByPosition( 0, 0, 1, 0 ):CharWeight = 150

oSheet:GetColumns():GetByIndex( i ):OptimalWidth = .T.


EMG