how can we do mail merge using libre office for MAC, in objective c?

I want to do mail merge for desktop application in MAC, using Xcode and objective c.

We will create a document using libre office with mail merge tags, and the program should load all the tags, and replace with the text through code.

Regards,
Vijay M