We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Wrong behaviour wile creating hyperlinks in MailMerge

Hi. I have made a templte for export.

Error in the table. Correct link makes only for one column, where I have made last modification inside {HYPERLINK }-field. If I modificate first column then I take correct link inside first colmn, and in the second column, if I modificated {HYPERLINK }-field in second column.

There are no exceptions in application logs.

Can you look what happens inside Aspose?

I’ve attached template(blogs_h.docx) and the result (BlogsActivityReportxxx.doc). You can see the both of {HYPERLINK }-field are identical. But correct hyperlink only inside only one column;

Also I’ve attached java model class BlogsActivityObject.java.txt to ensure that all fields was written correctly.

Hi Alexey,

Thanks for your request. The problem is in your template. If you press Alt+F9 to see field codes you will see that in the second column there is no MERGEFIELD inside HYPERLINK field. That is why the second hyperlink does not work as expected.

MS Word behaves very strange with MERGEFIELD nested into HYPERLINK. Once I open/save the document, MS Word converted the nested MERGEFIELD to simple text and that is why it is not filled. I had to modify the document using XML editor to make this work (see the attached template). But still once you open save the document in MS Word, the nested MERGEFIELD (hostignUrl) becomes simple text and does not work. Looks like bug in MS Word.

Best regards,