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

Free Support Forum - aspose.com

Text problem in merge field

Hello
I am using aspose in .Net web application to create school diplomas.
Our application replaces merge fields in students grades (numerical grades and literal grades).
Sometimes the text that replaces the merge field is in Hebrew and sometimes in English.
For some reason the English text in not align correctly but only in some cases and in other cases everything is ok.
what could be the problem?
Please check the red lines in the attached document, you will see that the same text sometimes looks right and sometimes has a wrong alignment.
Thank you

Hi Yosi,

Thanks for your query. It would be great, If you share your source document along with data-source to reproduce the same problem at our end and for investigation purposes.

Hi Yosi,


Thanks for your inquiry. I was unable to reproduce this issue on my side. I would suggest you please upgrade to the latest version of Aspose.Words i.e. v11.0.0. Moreover, I have tested your scenario by using the following code snippet:

Document doc = new
Document(@“C:\temp\template.doc”);

CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture;
Thread.CurrentThread.CurrentCulture = new CultureInfo(“he-IL”);

doc.MailMerge.Execute(
new string[]
{
ת1_ציון1_4_ב,
ת1_ציון2_4_ב,
ת1_ציון3_4_ב,
ת1_ציון4_4_ב,
ת1_ציון5_4_ב,
ת1_ציון6_4_ב,
ת1_ציון7_4_ב,
ת1_ציון8_4_ב,
ת1_ציון9_4_ב,
ת1_ציון10_4_ב,
ת1_ציון3_3_ב},
new object[]
{
“You have a good command of the study material”,
“You have a good command of the study material”,
“You have a good command of the study material”,
“You show interest and enthusiasm in lessons”,
“You persevere in the study of songs”,
“You have a good command of the study material”,
“You behave well in and out of class”,
“You show interest and enthusiasm in lessons”,
“”,
“”,
הינך שולט בחומר הנלמד});

Thread.CurrentThread.CurrentCulture = currentCulture;

doc.Save(@“C:\temp\out.doc”);

I have also attached the merged document (out.doc) i.e. generated on my side here for your reference.

Best Regards,

Thx for your reply
I am using version 6.0 and i can’t upgrade at the moment.
I am still facing the problem but the problem solved if the merge fields names will be in English and not in Hebrew.
Any ideas or other solution?

Hi Yosi,

Thanks for your inquiry.

We release a new version of Aspose.Words every month. Each new release contains many improvements, bug fixes and new features. So, we suggest you always use latest version of Aspose.Words.

In case of any ambiguity, please let us know.

I will upgrade soon but right now I am facing a problem in production site.
Can you please tell me why I have this problem only when the merge fields names are in Hebrew? (if the merge fields names are in English it works perfect)
thx

Hi Yosi,


Thanks for your inquiry. Unfortunately, it is difficult for us to say what the problem is as you are using quite an older version. I would suggest you please upgrade to the latest version of Aspose.Words i.e. v11.0.0. Moreover, please read the following article on How-to: Migrate to Aspose.Words 10.5 or Higher:
http://docs.aspose.com/display/wordsnet/How+to++Migrate+to+Aspose.Words+10.5+or+Higher

I hope, this will help.

Best Regards,