How to render date field according to set language using .NET | Set language for proofing tools

For multilingual reports (German and English), our customers use the “Set language for proofing tools” setting to format a date in MS Word.

Example -> date = 20.03.1967 -> {MERGEFIELD DATE \ @ “dd MMMM yyyy”}

If “Setting the language for the proofing tools” = “German”, “20 März 1967” is output.
If “Set language for proofing tools” = “English”, “20 March 1967” is output.
In Aspose Words, “20 März 1967” is displayed for both settings.

How can I get Aspose Words to use the setting stored in the template?

Aspose.Word.Testanwendung.zip (69.5 KB)

@Niebelschutz

Please use FieldOptions.FieldUpdateCultureSource property as shown below to get the desired output.

doc.FieldOptions.FieldUpdateCultureSource = FieldUpdateCultureSource.FieldCode;
var mailMerge = doc.MailMerge;

mailMerge.CleanupOptions = MailMergeCleanupOptions.RemoveUnusedFields |
			                MailMergeCleanupOptions.RemoveContainingFields |
			                MailMergeCleanupOptions.RemoveEmptyParagraphs;

Thank you for the fast answer.
I tried it and it works.
Our customer will be happy that it works again.

@Niebelschutz

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.