This was a problem that I was faced with at work recently, and having figured out how to do this, I thought the best thing to do was to present the solution with step by step instructions.
I wrote an article about this, and hope it proves useful to you. You can see the full details HERE.