Free Support Forum - aspose.com

MailMerge printing

Hello,

I’ve tried your demo, and it looks promosing. However when I print the generated word document I see that the names are replace by:

?FullName?
?Company?
?Address?
?Address2?
?City?


Dear ?FullName?,

This is also what is printed. Is it possible to create a “real” mailmerge, not changing the labels of the mailmerge fields of the mailmerge template document

Hi gnor,

I’m not exactly sure how do you get ?FullName? etc.

If you use online Aspose.Word demo it runs a “real” mailmerge in that it looks for mail merge fields inside the document, matches field name with the field name from your data set or array of values and inserts the value into the document. When document is saved it can be opened or printed and it will contain your values, not ?FullName?.

I’m just guessing, if you are not talking about online demo, but actually downloaded the component and trying to generate a document at your machine? In this case you maybe just opening a document and doing a mail merge without saving document to disk? Then you try to open the original document that of course has original field values like ?FullName?.

So to perform a mail merge you need to:
1. Open a document: Document doc = Word.Open(fileName);
2. Execute mail merge: doc.MailMerge(param, param)
3. Save the document into a new file (or the original file if you want to): doc.SaveAs(fileName);

Please tell us more about what you call “real” mail merge? What do you want to achieve?

Hello Romank,

I used the online demo (PersonalizedLetter.doc) and saved it to a file (local).

When I update the fields (eg. rightclick “James Bond” and select “Update field”) the “James Bond” text is replaced with “?FullName?”.
When I print, word automatically updates all fields which results in this problem for all mailmerge fields in the document.

“Real” is when I mailmerge from the mailmerge menu in Word, it generated a new document where all the mailmerge fields are physically replaced by the text (James Bond). There are no longer mailmerge fields in this newly generated document.

I hope I made it “Real” clear now.

regards,

Gnor

Hi Gnor,

Ok, I see it now. This was my misunderstand of how mail merge in Word works. Thanks for pointing out.

I have it fixed and uploaded as Aspose.Word 1.1 Beta. Now Aspose.Word complete replaces mail merge field with text. Not uploaded to online demo.

Final Aspose.Word 1.1 will be released 20th Jan.