I just love Open Office! It’s free, all data is stored as a zip’d XML, it can be automated using COM (and various other API’s), it can produce quality PDF’s and most importantly, it’s not a Microsoft product. What a fantastic program and an excellent opportunity for integration with Notes.
This database is an example of how to integrate Open Office (OoO) with Lotus Notes using COM automation. It exports information from an Invoice document in a Notes database into a OoO Writer document. The Writer document is then formatted sincely into a printable invoice, then both a completed PDF and OoO version is re-attached to the Invoice document in Notes - all within a few seconds!
I use a variation of this system in my business for sending out invoices to clients and it works really well. Saves me heaps of time mucking around formatting documents etc.
Download the Demonstration
Download the Open Office & Notes Integration demonstration database (200kb)
How To Use The Demonstration Database
In the Invoice by Status view, use the New Invoice button to create a new Invoice. Complete all fields on the Invoice Form (yes, I know there’s a lot, sorry). Create a number of Invoice Detail documents (optional - these are used to breakdown large costs into smaller identiable items). Click the Generate Invoice button to execute the code which will then:
- Launch Open Office
- Export the Notes data
- Generate a OoO file and a PDF file, and then
- Attach the Resultant files back to the original Invoice document.
Tip: To make things easier for this demonstration, inheritance has been enabled on the Invoice form, so if you select the existing Invoice document and click New Invoice you’ll get a pre-populated Invoice.
The ooo-template view contains a Open Office document used as a template for the Invoice. To change the Invoice layout, simply change this template.
Other Useful Resources:
- It obviously requires an installation of Open Office, download from http://www.openoffice.org
- http://api.openoffice.org/DevelopersGuide/DevelopersGuide.html
- http://www.ooomacros.org
- http://www.oooforum.org
Questions?
If you have any questions about this demonstration, then please contact us.






May 24th, 2005 at 7:14 am
This is a great news for me and Lotus Notes developer community!!!
I am looking for how can I replace MS office with OpenOffice tool in the current report functionality (export to excel)that I have in my lotus notes applications. Could you help me how can I do it? in order to start to avoid any Microsoft dependency…
Thanks in advance for any help…
regards,
Rigo
June 24th, 2005 at 3:52 pm
What are all the limitations in this database?
June 29th, 2005 at 8:51 am
“What are all the limitations in this database?” - I do not understand your question.
October 5th, 2005 at 5:30 am
I’ve tried this with the new OpenOffice 1.9.130 and with an .ODT file as the template. Works great!! Nice work especially the code for creating the PDF-files.
However we would like use OpenOffice for modifying the document and then save the attachment back into Domino (like Swing software or Bowtie for Ms Office) and data exchange both ways.
I’ve seen this on www.n2office.com but this seems to be only marketing.
Are you planning to enhance the functionality in this direction?
October 7th, 2005 at 10:17 am
Currently the process flow goes like this:
Domino data to Open Office Document
Open Office Document converts to PDF
Domino attaches both Open Office Document and PDF to Domino document
And that’s all automated.
So if you want to change it to:
Domino data to Open Office Document
* User edits Open Office Document *
Open Office Document converts to PDF
* Open Office attaches Open Office Document and PDF to new Domino document *
Then it’s really a question of coding the logic into the Open Office template so that it knows how to interact with Domino.
Now here’s the really cool part. In Open Office you could use the Domino CORBA classes to reattach the document to Domino or possibly even the native Domino Java classes. So yes, it should be do-able.
I recall a number of years ago where I did a similiar level of automation with Excel and Word documents. By adding a “Save to Domino” item in the File menu. That was just using VBA. Open Office is pretty sophisticated in the IDE so it should be very do-able.
December 13th, 2005 at 3:01 am
I’ve tried this but when I click on the button “Generate Invoice” the script is interrupted by the follow error: “Cannot create automation object” the row with the problem is the seguent “Set xlapp=createobject(”com.sun.star.ServiceManager”)”.
Thanks in advance 4 any help
December 13th, 2005 at 8:12 pm
re: Tizy. It sounds like Open Office is not installed or has not registerd the components correctly. Have you tried reinstalling OoO? And did you restart Notes after the OoO install?
January 27th, 2006 at 2:08 am
I’ve the same problem of Tizy Says.
When i run my agent from web browser the script is interrupted by the error: “Cannot create automation object” at the row “Set objServiceManager=createobject(â€com.sun.star.ServiceManagerâ€)â€.
If I run your agent from client then i’ve not problems.
Can you help me? Thanks
January 27th, 2006 at 5:44 am
@Giacomo.
I assume you are running the agent on the Domino Server via the Web. If this is the case, then have you installed OpenOffice on the Domino server?
January 27th, 2006 at 6:19 pm
Yes, I did. I work directly on the server, on Notes client also on IE browser, but on browser i’ve the error. thanks
January 27th, 2006 at 6:27 pm
Have you tried increasing the Agent permissions? Check the Agent properties box, permissions tab. You may need to give the agent unlimited access.
February 2nd, 2006 at 8:25 pm
Hi, I reinstalled OpenOffice’s client and resolved my problems. A new question for you. Why have You chosen to make the ReplaceSubstring and not the MailMerge function? thanks
February 7th, 2006 at 12:00 pm
It was easier to manage where the placeholders were inserted into the target document.