OpenOffice project celebrates 100 million downloads since version 3.0
Just over one year after the release of OpenOffice 3.0, OpenOffice.org (OOo) project developer Joost Andrae has announced that the free office suite has been downloaded more than one hundred million times since the launch of version 3.0. Read full story here
Yes, it still sucks, unlucky OO. It is still slow, not user friendly, not compatible with MS Office. But this is not what I am about.
It has nice batch processing features which no competitors have. About them I want to tell today.
I would call this feature unattended usage. And it rocks.
Strong points of OpenOffice are
- Works on linux/windows.
- It can open A LOT of file formats
- It can save to many file formats
- It can run Macros, even VBA with http://go-oo.org
It can do hell of alot things!!!! Why not to use it ?
What for ?
Imagine you have to index 1000 doc document ?
Or upload excel table to site and extract all data from it ?
Or convert 10000 document to PDF ?
How to do it ?
OpenOffice usage
Lets try something simple at first time, for example how to convert DOC to PDF ?
Here is example using Office 3.1 for how to convert from MS Word DOC to Adobe PDF.
Run OpenOffice and open in main menu Tools -> Macro -> Organize Dialog -> Modules -> My Macros
Click New button and choose name: Module1.
Insert this code into module and save
Sub SaveAsPDF( cFile ) Dim oPropertyValue As New com.sun.star.beans.PropertyValue cURL = ConvertToURL( cFile ) ' Open file oPropertyValue.Name = "Hidden" oPropertyValue.Value = True oDoc = StarDesktop.loadComponentFromURL( cURL, "_blank", 0, _ Array(oPropertyValue,)) ' Generate PDF name in same directory cFile = Left( cFile, Len( cFile ) - 4 ) + ".pdf" cURL = ConvertToURL( cFile ) ' Save the document using a filter. oPropertyValue.Name = "FilterName" oPropertyValue.Value = "writer_pdf_Export" oDoc.storeToURL( cURL, Array(oPropertyValue)) oDoc.close( True ) End Sub
To execute this macro in unattended mode run this command:
soffice.exe -invisible "macro:///Standard.Module1.SaveAsPDF(c:\sample.doc)"
Check c:\ it should contain sample.PDF
Thats it!
You can use your editor for macros, Macro files are stored XML files, for windows look for them in
c:\Document and Settings\<user>\Application Data\OpenOffice.org\3\user\basic\Standart
Same method works in Linux. You can do it on headless server.
This is simple case. If you want to dive deeper try to google for UNO.
black classic cardy ugg boots…
through only the templates files. Very rarely have I had to touch the actual WP’s files. At the very least, it makes upgrading easy….