Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files from any .NET platform (C#, VB.NET, ASP.NET, .NET Core) and Java applications (J2SE and J2EE) with fast and high quality performance.

Tue Jul 30, 2019 7:43 am

Hi,

Is there a possibility to have the date field in the language I want ?

Code: Select all
string docWord = @"Put the path of the file HERE";                             // TO MODIFY
Spire.doc.Document doc = new Spire.doc.Document();
Spire.doc.Section section = doc.AddSection();
Spire.doc.Documents.Paragraph para = section.AddParagraph();

para.AppendField("\"\\@\"dd MMMM yyyy", SPI.FieldType.FieldDate);           

doc.SaveToFile(docWord);


The result I have with this code : "30 July 2019"
The result i would like to have : "30 Juillet 2019"

thbryer
 
Posts: 10
Joined: Wed Apr 24, 2019 6:33 am

Tue Jul 30, 2019 9:59 am

Hello,

Thanks for your inquiry.
Please kindly refer to the following sample code to achieve your requirement, if there is any question, just feel free to write back.
Code: Select all
......
 Document document = new Document();
 Section section = document.AddSection();
 Paragraph paragraph = section.AddParagraph();
 Field field = paragraph.AppendField("\"\\@\"dd MMMM yyyy", FieldType.FieldDate);
//set to show field text in French
 field.CharacterFormat.LocaleIdASCII = 1036;
 document.SaveToFile("Sample.docx", Spire.Doc.FileFormat.Docx2013);
......

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1049
Joined: Wed Apr 25, 2018 3:20 am

Tue Jul 30, 2019 2:28 pm

Thanks for your fast response, it works !

thbryer
 
Posts: 10
Joined: Wed Apr 24, 2019 6:33 am

Wed Jul 31, 2019 1:11 am

Hello,

Glad to hear that! If you encounter any issue related to our products in the future, just feel free to contact us.
Wish you all the best!

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1049
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.Doc