Fun with OpenOffice.org email merge!


So for a long time I've been trying to get this to work – apparently it worked in very early versions of OpenOffice.org, but then was later dropped. However, there was talk and talk and talk of it being finally included in OpenOffice.org version 2 – and all the early beta versions of 2.0 (1.9.xxxx, etc) all looked like they included the option. So every month or two I would grab the latest release and try it out -


The message that it gives you is that it cannot find JavaMail, which it claims it needs to do the email merge. However, no matter which way I tried to install Java and JavaMail (including going to “Tools – Options” in OpenOffice.org and adding javamail and its required jaf to the classpath), OOo would not recognize it and install it.


So after much digging and frustration I came across the sinister truth -


http://sw.openoffice.org/servlets/ReadMsg?list=dev&msgNo=1089


According to Oliver.Specht@sun.com,


the message to install Java Mail doesn't tell the complete truth. To

access the Java Mail API from the mail merge wizard requires an

additional service ( com.sun.star.mail.MailServiceProvider ) that is not

availabe for OOo, and an additional configuration entry.


Sorry, I cannot answer the question how to get it.”


So for some reason that text was still left in there from StarOffice (I'm assuming), even though actual code to implement it was taken out of OpenOffice.org. Which is so annoying and misleading. I'm sure I'm not the only one to spend hours attempting to install JavaMail in frustration. And there seems to be no official posting or FAQ that lets us know this. Which is why I'm putting together this document.


So no matter how you install JavaMail, (which also, by the way, requires you to install the javabeans activation framework from Sun), the email merge will not work.


Good news, however, I finally figured out how to get it to work!


Apparently there's a patch to the source code to implement this,

http://qa.openoffice.org/issues/show_bug.cgi?id=51638,

but I myself am not sure how to use this – I'm not up to compiling the code myself, especially if I need to patch something in first. And it's unclear when it's going to make it into a release. Hopefully soon.


But until then, I found that the same python code that works that patch can be installed in a different way -


Here's how I got it to work -



This guy Caolan wrote this python code and posted it on his blog -


http://blogs.linux.ie/caolan/2005/07/05/email-mailmerge

here is the python file:

http://people.redhat.com/caolanm/mailmerge/mailmerge.py

Thank you very much Caolan!!


I've put it locally here just in case: mailmerge.py


But he doesn't make it too clear how to go about using it. The instructions are actually in the comments at the top of the python file.


I'm using OOo 2.0 on Windows XP, his instructions are for linux.


You should probably be out of OpenOffice (close the program) when you do all of this.




<prop oor:name="EMailSupported" oor:type="xs:boolean">

<value>false</value>

</prop>


and change the “false” value to “true”.


Then get back into openOffice. That's what I did and now the email merge works for me. It even did my SMTP server authentication.


I found the mail merge interface to be a bit clunky on both versions of openOffice, but finally I figured it out with the help of the help file. Once you get the trick of mail merging down, the email merge is easy to figure.


I can't stand the prepackaged “address block” and “salutation” things because they never match my fieldnames – and the dang wizard doesn't tell you how to put in your own fields outside of the salutation and address block –


so on step 6, the “Edit Document” step, I hit “Edit Document”, then F4 to pull up the data explorer, pull up my data source table in the data explorer, and put in the fields by dragging the field headers down. You can also hit Ctrl-F2, which is the “Insert Fields” shortcut, then go to the “Data” tab, then go to “Mail Merge Fields” and drag them from there. It works well, but is counterintuitive and not obvious at all to me, who am used to mail merges in Adobe Pagemaker, Avery Designer, and MS Word.


Also I found it very confusing that you can't do a label merge by starting from the “Mail Merge Wizard” - I find where I work, we do merges to labels much more often than we do merges to letters. Being used to Micro$quish Word, I was not at all inclined to start looking under “File – New – Labels” - which is what you have to do. In MS, you go to Mail Merge Wizard under Tools, and the option for Labels is there – one place to go for all mail merges.


Ah well. At least it works, it is much improved over OOo 1.x series, and it covers it in the help file.


Enough ranting. I hope this clears things up and works for others, as it did for me. I think it will.


Happy email merging!!!


Aaron W

feedback on this doc? I'd love to hear it – OOo_email_merge.20.hummusman@spamgourmet.com