We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Preparing a Document in OpenOffice

Hi there

I was interested to know we could create a document as described below in Openoffice, and if so how?



This message was posted using Page2Forum from Prepare a Document - Aspose.Words for .NET and Java

Hi Jason,

Using Aspose.Words you can load and use a similar document to the one you specified in .ODF format. Check here for details of the features supported in ODF.

I’m not quite sure what it is your requesting though, could you clarify exactly what part you are having trouble with?


Hi Adam,

Thank you for the prompt response. We were looking to create a Mail Merge Document in Openoffice, we had tried using the one we give our clients from Word but it removes the merge fields.

What is the best way that we could create these documents in Openoffice?


Hi Jason,

Cheers. Can you attach your document here and the code your using and we'll take a look at whats happening.



<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. To insert merge fields in OpenOffice, you first should setup Mail Merge data source. This can be a simple TXT file, which contains field names separated by coma. Please see the following link to learn how to setup data source:


Once your data source is setup, you can insert merge fields. Go to Insert/Fields/Other menu, select Database tab, select “Mail merge fields” and then select name of field from your data source.

Unfortunately, OpenOffice does not allow inserting merge fields without data source.

Best regards.

Thanks Alexey.

I have just tried this and it doesn't seem to merge my document with our data. Is it possible for you to send me a sample document that I could take a look at?

Would I need to collect the data from our database and then run the merge or could it work from our application?

Also, does it matter what the document type is?



<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. I attached sample template and output document produced by the following code:

// Open template.

Document doc = new Document(@"Test001\in.odt");

// Execute simple mail merge.

doc.MailMerge.Execute(new string[] {"FirstName", "LastName", "City"}, new object[] {"James", "Bond", "London"});

// Save output document.


Hope this helps.

You can execute mail merge in your application, you should just properly setup your template.

Best regards.

Many Thanks Alexey, we have this working now.

Just one more question if I may, how do I format my amount fields to show as $$ currency when we run the merge? I have tried changing the fields to currency and it doesn't seem to pick these up.



<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. You can specify format of data using formatting switches. Please see the following link to learn more about formatting switches in merge fields:


However, unfortunately, I cannot see any option in OpenOffice to specify this in the field’s code. I suppose, OpenOffice stores format of merge field somewhere in different place. So the only option, I can suggest at this stage is using MS Word to create templates.

Best regards.