Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Fri Apr 10, 2020 3:14 pm

Hi, I have a problem when replacing the merge field by the hyperlink which also include the if condition in mail merge, the hyperlink is displayed in wrong position (should be same as merge field position but it is in front of the if condition), I'm stuck with this like 2 days, and I think it's a bug of yours.

Original purpose: format the merge field to be in html
With the simple attached code, everything seems fine.
Issue: If the text of merge field includes hyperlink and in condition, it's not working as expected anymore => the html text is displayed in wrong position.

E.g: replace the link by something like google: <a href="link" rel="noopener noreferrer" target="_blank">link</a>, encode first if needed
More info: The appendHtml works fine, but I want something like insertHtml. The problem only occurs when merge field is in if condition.

I've attached the doc template and the simple code
Pls help take a look. Thanks

binhjy123
 
Posts: 4
Joined: Fri Apr 10, 2020 10:25 am

Mon Apr 13, 2020 2:17 am

Hi

Any update for this one? Do you get the issue? Have you tried to reproduce it?
I'm looking forward to the answer.

binhjy123
 
Posts: 4
Joined: Fri Apr 10, 2020 10:25 am

Mon Apr 13, 2020 10:18 am

Hello,

Sorry for the late reply.
Based on your code snippet, I simulated the full code and tested your case, but didn’t reproduce your issue. My output file is different from yours, please see the attached screenshot. To help us investigate your issue more accurately and quickly, please provide your full code (or a runnable project) and your output .docx and expected .docx. Thanks in advance.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Tue Apr 14, 2020 2:30 am

I already replied to the email yesterday with more code. Contact me through email if you still can't reproduce it.
Regards.

binhjy123
 
Posts: 4
Joined: Fri Apr 10, 2020 10:25 am

Tue Apr 14, 2020 8:24 am

Hello,

Thanks for your more information. Below are my investigation results:
1. The field code of the “IF” field in your template document is incorrect, please see the attached picture ”FieldCode.png” for the correct field code. Also attached the corrected template (template.docx) for your check.

2. The website you provided is not available on my side. I found that the main function of your application is to merge fields and finally convert the Word document to HTML string. Hence I did a test based on your application and finally saved to a html file. Then I found the generated html file has the issue you mentioned. The attached file “output.html” is my output.

3. To better locate your issue, I saved the document object to a local file (please see the attached file “result.docx”) after the mail merge. Then I found the IF field is not updated correctly, please see the attached picture “UpdateFiled.png”. You could also verify it on your side. This issue and the above issue have been logged into our bug tracking system with the ticket SPIREDOC-4223. If there is any update, we will inform you.

4. In addition, I manually updated the IF field in Microsoft Word and then converted it to the html file, but found the text “https://www.google.com” has not been parsed into the <a> tag, please see the attached picture “MSWord.png”. Our Spire.Doc is based on Microsoft Word, thus, after the issue SPIREDOC-4223 is fixed, the final result will also be consistent with Microsoft Word. Hope you can understand.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Wed Apr 15, 2020 4:34 am

Hi,
Thanks a lot for your effort.
Hopefully this issue can be fix soon.
Regards.

binhjy123
 
Posts: 4
Joined: Fri Apr 10, 2020 10:25 am

Wed Apr 15, 2020 7:28 am

Hello,

You are welcome. Once the issue is fixed, we will notify you ASAP.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.Doc