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

Free Support Forum - aspose.com

Date language problem?

While using the same word document for merging. (Im not using DocumentBuilder)

After a number of merges on the same computer date switch from

21 Mars 2012 (French) to 21 March 2012 (English)

I have not been able to reproduce it like i want. It happen once in a while..

I made some test, tried to use dutch, russian and english on my thread before merging to try to reproduce it but it didnt change my date language. It stayed in french.

After i reboot my computer everything seem to be working back.

I know its not very clear. Just wondering if you heard about something like this and can help me trace the problem.

Thanks

Hi Claude,


Thank you for inquiry. Unfortunately, it is difficult for us to say what is the problem. Could you please share the input file along with code snippet. We’ll guide you accordingly.

Hi Claude,


Thanks for your inquiry.

Does this issue happen with different templates or with the same template each time? Also, what setting are you using under doc.FieldOptions.FieldUpdateCultureSource when this issue occurs?

Thanks,

Im currently using "CurrentThread"

We have now traced that our main thread was being changed to another culture.

We have double checked our application for culture change, we are currently tring to point out when our culture is changed.

Is there anything on your side changing the culture that might not restore the original culture?

We are using multiples components so we are guessing the culture change come from one of our component..

Is there any way to ignore the culture and force it ?

Thanks

Hi

Thanks for your inquiry. I am afraid there is no way to ignore culture. Anyways Aspose.Words needs some culture to format values of fields. As a workround, you can try settgin culture of the current thread before updating fields. For example:

// Set culture that should be used.

CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture;

Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

// Here you can open template and execute mail merge.

// Restore the original culture

Thread.CurrentThread.CurrentCulture = currentCulture;

Hope this helps.

Best regards,