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.
Unfortunately, activation email could not send to your email. Please try again.

MailMerge NullReferenceException

Thread ID:

Created:

Updated:

Platform:

Replies:

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

Hi,

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);
document.Close();
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
Gernot

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

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 13.3.0.7 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:
http://www.syncfusion.com/downloads/support/directtrac/general/ze/DocIO_UWP-573470430.zip

Please let us know if you have any questions.

Regards,
Ayswarya


Gernot Gutschi
Replied On December 20, 2015 03:37 PM

Hi,

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?

Regards,
Gernot

Attachment: template.merge_3ac2a109.rar

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

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

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Regards,
Sarath


CONFIRMATION

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.

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.

;