Hi all,
For years (since 2006) I have been using COM components with libre/openoffice API in another programming language to execute tasks on files (text replacement, file merging, pdf printing, etc).
Basically this API opens a libre/open office instance and 'automates' actions by code, which is very useful and free to use.
This example, loads a libreoffice text file and replaces 'texttoreplace' with another text.
oSM = COMate_CreateObject("com.sun.star.ServiceManager")
oDesk = oSM\GetObjectProperty("CreateInstance('com.sun.star.frame.Desktop')")
oDoc = oDesk\GetObjectProperty("loadComponentFromURL('"+ConvertToUrl(filename)+"', '_blank', 0, " + Str(openarray) + " as variant)")
oSrch = oDoc\GetObjectProperty("createReplaceDescriptor")
oSrch\SetProperty("SearchString ='texttoreplace'" )
oSrch\SetProperty("ReplaceString = 'REPLACED TEXT'")
oDoc\Invoke("replaceAll("+Str(oSrch)+" as COMateObject )" )
I would like to port this functionality to my B4J projects and have found there is a
JAVA API too, but i really don't know how to start using it in B4J.
Can someone point me in the right direction?
Thanks.