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. Image for the cookie policy date
close icon

IF and mergefields

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.

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

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

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



1 Reply

BP Bhuvaneswari P Syncfusion Team 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,
Bhuvana



Loader.
Live Chat Icon For mobile
Up arrow icon