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

IF and mergefields

Thread ID:





80499 Apr 7,2009 05:56 AM UTC Apr 8,2009 11:35 AM UTC WinForms 1
Tags: DocIO
Administrator [Syncfusion]
Asked On April 7, 2009 05:56 AM UTC

I have a .DOC template file that has the following fields, for some reason the { MERGEFIELD "Company_Name" } that immediately follows the IF is " ", instead of empty "".
The { MERGEFIELD "Company_Name" } at the end of the statement is empty. I can confirm that the value passed to DocIO is an empty string.

Using the WordDocument.MailMerge functionality.

{ IF "{MERGEFIELD Company_Name }" = "" "{ MERGEFIELD "Contact_Name"}" "{MERGEFIELD Company_Name }" }

Actual field output:
{ IF " " = "" "Tim" "" }

Expected field output:
{ IF "" = "" "Tim" ""}

Bhuvaneswari P [Syncfusion]
Replied On April 8, 2009 11:35 AM UTC

Hi Tim,

Thank you for your inquiry.

1. Regarding field update:

Field value updated only after opened in MS word and update the fields (Select all (Ctrl+ A) and then press F9). Fields values and condition will not be executed by programmatically it can be done only after opened in MS word and giving field update. This is the behavior.

2. Merge field adding one extra space when field inside the if condition
I am able to reproduce the issue. The issue "Merge field adding one extra space when field inside the if condition“ reported by you is suspected to be a defect. We have forwarded this to our Development Team for further analysis. We will update you with our Development Team’s response in two business days.

Also we have updated the same in your direct trac incident. Please follow up it for the further questions.

Best Regards,


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