We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

MailMerge NullReferenceException

Thread ID:





121089 Nov 10,2015 05:59 AM UTC Dec 21,2015 10:22 AM UTC UWP 3
Tags: DocIO
Gernot Gutschi
Asked On November 10, 2015 05:59 AM UTC


I'm using the simple MailMerge example of your help pages (where I replaced Template.docx through my own template file). The given fieldNames do exist in the word template. 

WordDocument document = new WordDocument(filename);
string[] fieldNames = new string[] { "Emp_Id", "Name", "Phone", "City" };
string[] fieldValues = new string[] { "1001", "Peter", "+122-2222222", "London" };

//Performs the mail merge.
document.MailMerge.Execute(fieldNames, fieldValues);

//Saves and closes the WordDocument instance
document.Save("Sample.docx", FormatType.Docx);
I'm getting a NullReferenceException at the "Execute" statement (StackTrace: "at Syncfusion.DocIO.DLS.WField.UpdateFieldRange()"). Is there a bug or am I doing something wrong?
Best wishes

Ayswarya Krishna Kumar [Syncfusion]
Replied On November 11, 2015 08:22 AM UTC

Hi Gernot,

Thank you for using Syncfusion product.

We are unable to reproduce the mentioned ‘Null Reference Exception in UpdateFieldRange()’ method of WField class. We have tested the given scenario with public version assemblies. For your reference, we have attached the sample which we have tried to reproduce the issue at our end. Kindly modify the sample to reproduce the mentioned Exception issue in UpdateFieldRange() at our end and also please provide us template document you have used for performing MailMerge operation which causes the issue, so that we could analyze further and update you with more appropriate details on the mentioned issue.

Please, find the sample from the following link.

Sample link:

Please let us know if you have any questions.


Gernot Gutschi
Replied On December 20, 2015 08:37 PM UTC


if I use your example and the attached Word file, I get the mentioned exception.

I also have another question (not sure if I should start a new thread for it):
Is mail merge with groups not supported in UWP?


Attachment: template.merge_3ac2a109.rar

Sarathkumar V [Syncfusion]
Replied On December 21, 2015 10:22 AM UTC

Hi Gernot,

We have created a support incident for the reported Null reference exception issue while performing mail merge using DocIO under your account.
Please log on to our support website to check for further updates




This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon