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

Free Support Forum - aspose.com

Mail merge field embedded in a shape

I have a Word template in which some of the mail merge fields are embedded within a shape object. These fields are not being populated by MailMerge.Execute, nor are they being returned by MailMerge.GetFieldNames. Is there a way to merge data into these fields?

Hi,

Thanks for your inquiry. Could you please attach your input Word document and source code here for testing? I will investigate the issue on my side and provide you more information.

Best regards,

Here you go: The template, data file, and source code are in this zip. Also, I noticed we have an old version of Aspose.Words (6.5). I wanted to see if the newest version would solve this issue so I downloaded the trial. Unfortunately there’s no license in the download and I haven’t received one via email.

Hi,


Thanks for your inquiry. While using the latest version of Aspose.Words for .NET i.e. 13.7.0, I was unable to reproduce these issues on my side. I would suggest you please upgrade to the latest version of Aspose.Words. You can download it from the following link:
http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/default.aspx

I hope, this helps.

Secondly, we welcome you to evaluate the latest version of Aspose.Words, please read the following article:
http://www.aspose.com/docs/display/wordsnet/Evaluate+Aspose.Words

Best regards,

I just tried again using the latest (evaluation) version of the product and I’m having the same problem. The fields that are not embedded in the shape object (Customer Name, Billing Address, City, State, etc.) are merging correctly. The shape object is not being rendered at all on the output .pdf.

Hi,


Thanks for your inquiry. But, I ran your code and produced the Pdf document without this problem. Please find attached a Pdf i.e. produced on my side using Aspose.Words for .NET 13.7.0. You can see merge fields contained inside Textbox shape under “My Plan” heading are populated correctly. Could you please double check if you are using the latest version (13.7.0) on your side? You can dynamically check if you’re referencing the correct DLL by using the following code snippet:

System.Reflection.Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
foreach (System.Reflection.Assembly assembly in assemblies)
{
System.Reflection.AssemblyName assemblyName = assembly.GetName();
if (assemblyName.Name.Contains(“Aspose.Words”))
Console.WriteLine("Aspose.Words Version Number: " + assemblyName.Version.ToString());
}

Best regards,

That did it! I guess I hadn’t actually bound the latest assembly. Thanks for your help.

Hi,


Thanks for your feedback. In case you have further inquires or need any help, please let us know. We’re always glad to help you.

Best regards,