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

Free Support Forum - aspose.com

MailMerge- XML

There tutorial about MailMerge and XML, but only C and vba. I want to do the same in java.
Is it possible ?

Thx

Hello

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

Thanks for your request. Yes of course you can do MailMerge using Aspose.Words for Java. Just use the following line of code:

doc.getMailMerge().execute(…)

You can download the latest version of Aspose.Words for Java from here:

http://www.aspose.com/community/files/72/java-components/aspose.words-for-java/category1378.aspx

Best regards,

I try create region merge. But iwant make simple like exemple about merge :

doc.getMailMerge().execute(


new String[] {“FullName”, “Company”, “Address”, “Address2”, “City”},


new Object[] {“James Bond”, “MI5 Headquarters”, “Milbank”, “”, “London”});

But exemples about region merge use resultSet and sql request.

It is possible use anything else ?


Thx


Hello

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

Thanks for your inquiry. You can use IMailMergeDataSource, please see the following link:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net-and-java/com/aspose/words/imailmergedatasource.html

Best regards,

i want to use IMailMergeDataSource with mail merge region.

My code is:
CustomerList customers = new CustomerList();
customers.add(new Customer(“Thomas Hardy”, “120 Hanover Sq. London”));
customers.add(new Customer(“m Platon”, “Dublin”));

CustomerMailMergeDataSource customersDataSource = new CustomerMailMergeDataSource(customers);

doc.getMailMerge().executeWithRegions(customersDataSource);

And my word file is

{MERGEFIELD TableStart:Customer \* MERGEFORMAT}

{MERGEFIELD mFullName \* MERGEFORMAT}

{MERGEFIELD mAddress \* MERGEFORMAT }

{MERGEFIELD TableEnd:Customer \* MERGEFORMAT}


And after execute my code , i have:


Evaluation Only. Created with Aspose.Words. Copyright
2003-2008 Aspose Pty Ltd.

{MERGEFIELD mFullName \* MERGEFORMAT}

{MERGEFIELD mAddress \* MERGEFORMAT}

{MERGEFIELD mFullName \* MERGEFORMAT}

{MERGEFIELD mAddress \* MERGEFORMAT}




I don’t understand.
is it possible use IMailMergeDataSource with mail merge region or not ?
And if yes, what (where) is my mistake ?



i find my mistake.
<span style=“font-size: 12pt; font-family: “Times New Roman”,“serif”;” lang=“EN-US”>{MERGEFIELD
mFullName * MERGEFORMAT} This code is wrong.
Indeed the code must be : <span style=“font-size: 12pt; font-family: “Times New Roman”,“serif”;” lang=“EN-US”>{MERGEFIELD FullName * MERGEFORMAT}
i have write “m” before FullName…

Thx for all anyway.

Hello

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

It is perfect, that you already resolved the problem.

Best regards,