Mail Merge with XML data using Aspose.Words Cloud API

I’m wanting to populate an invoice using Aspose Cloud’s MailMerge (as if that wasn’t obvious from my last posting :slight_smile: ).


My XML data looks like this:

2013-07-28 Sun 22:10
2013-07-29 Mon 05:10
2013-07-29 Mon
2013-07-29 Mon
2013-07-28 Sun 22:10
2013-07-29 Mon 05:10
0
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
New
DAWX89

Prof.
David

Brown

Chemist
david84@outlook.com
01722 698738
02588 296787
07179 674129

Lorem ipsum dolor sit amet, consectetur adipiscing elit.Praesent sollicitudin iaculis dignissim.Praesent sollicitudin iaculis dignissim.

Praesent sollicitudin iaculis dignissim.

Praesent sollicitudin iaculis dignissim.Praesent sollicitudin iaculis dignissim.

Praesent sollicitudin iaculis dignissim.Praesent sollicitudin iaculis dignissim.

Praesent sollicitudin iaculis dignissim.

Praesent sollicitudin iaculis dignissim.


52 King Crescent
Peckham
Lancashire
LG43-5PJ
United Kingdom

52 King Crescent
Peckham
Lancashire
LG43-5PJ

52 King Crescent, Peckham, Lancashire, LG43-5PJ

Prof. David Brown
David Brown
Prof. David Brown
Brown , David
M: 07179 674129 H: 01722 698738 O: 02588 296787


£35.83
12
58
£43.00
1.2
Lorem ipsum dolor sit amet, consectetur adipiscing elit.


£60.83
14
59
£73.00
1.2
Lorem ipsum dolor sit amet, consectetur adipiscing elit.


£35.00
20
60
£42.00
1.2
Lorem ipsum dolor sit amet, consectetur adipiscing elit.


£70.83
12
61
£85.00
1.2
Lorem ipsum dolor sit amet, consectetur adipiscing elit.


£50.00
18
62
£60.00
1.2
Lorem ipsum dolor sit amet, consectetur adipiscing elit.


£72.50
0
63
£87.00
1.2
Lorem ipsum dolor sit amet, consectetur adipiscing elit.


£29.17
0
64
£35.00
1.2
Lorem ipsum dolor sit amet, consectetur adipiscing elit.


£75.00
15
65
£90.00
1.2
Lorem ipsum dolor sit amet, consectetur adipiscing elit.


£9.17
11
66
£11.00
1.2
Lorem ipsum dolor sit amet, consectetur adipiscing elit.


£25.83
16
67
£31.00
1.2
Lorem ipsum dolor sit amet, consectetur adipiscing elit.


£44.17
18
68
£53.00
1.2
Lorem ipsum dolor sit amet, consectetur adipiscing elit.


£55.83
17
69
£67.00
1.2
Lorem ipsum dolor sit amet, consectetur adipiscing elit.


£11.67
12
70
£14.00
1.2
Lorem ipsum dolor sit amet, consectetur adipiscing elit.

13
£691.00

I can get this to work in Aspose/Saaspose by using moustache fields (see https://docs.aspose.cloud/words/mail-merge/ ), so I have fields that look like {{Client.Address.Street}}, as well as {{#foreach Item}}{{/foreach Item}}

This works fine - but I’d like to use Word’s built-in mail-merge fields. Can anyone let me know if the “object notation” is supported by Aspose for this purpose? I already have TableStart/TableEnd working fine, but I’d also like to have fields like {MERGEFIELD Client.Address.Street * MERGEFORMAT }

I would experiment and try it out myself, but it would involve a lot of work to modify my tools to support it, so I’d appreciate if someone could tell me if it would work or not and save me from wasting time, thanks!

Update:
I take back what I about it working - when I run my Word document against the XML data I put in this post, Aspose converts the moustache-fields into Merge fields, however it does not populate the fields with data at all. I’ve attached my Word document. Pray tell, what am I doing wrong?

Hi David,

This is working at my end without any issue. Can you please share your document with merge fields for further investigation?

I updated your document and added 3 merge fields and used it with the following XML. Output document is also attached.

<?xml version="1.0" encoding="utf-8" ?>


John Smith


Street1

City1




Best Regards,