Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Sat Apr 04, 2020 11:12 am

Hello, I need to set the default language to Spanish. I saw your sample How-to-alter-Language-dictionary-via-Spire.Doc.html but I don't want to set it for each TextRange; is there a way to set it at document level for the whole document? I create a document from scracth and I need it to be in Spanish.
Thanks!

visualboy
 
Posts: 5
Joined: Fri Apr 03, 2020 3:30 pm

Mon Apr 06, 2020 7:43 am

Hi,

Thanks for your post.
Please refer to the following code to set the default language for whole document.
Code: Select all
 Document document = new Document();
            //if you create a new document, you need to add Normal style first.
            document.AddStyle(BuiltinStyle.Normal);
            Style style = document.Styles.FindByName("Normal");
            style.CharacterFormat.LocaleIdASCII = 10250;
            Section section = document.AddSection();

            Paragraph paragraph = section.AddParagraph();
            paragraph.AppendText("Hola mundo");
            string result = "result.docx";
            document.SaveToFile(result, FileFormat.Docx2013);


Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Thu Apr 09, 2020 7:26 am

Hi,

Hope you are doing well.
Does my code help for you?
Looking forward to your feedback.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Thu Apr 09, 2020 8:16 am

Yes, I tried and it seems to work, thanks!

visualboy
 
Posts: 5
Joined: Fri Apr 03, 2020 3:30 pm

Thu Apr 09, 2020 9:17 am

Hi,

Thanks for your feedback.
I am glad to hear that it works.
Feel free to contact us if you need any other help.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Mon Jun 07, 2021 9:16 am

Hi!

Where can we find the different languages and their codes?

Thank you!!

beatriz.gomezcarrero
 
Posts: 5
Joined: Mon May 24, 2021 7:51 am

Mon Jun 07, 2021 10:44 am

Hello,

Thanks for your inquiry.
You can find the different languages and their codes from the link below.
https://docs.microsoft.com/en-us/opensp ... b0ee3dbc4a

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Tue Jun 15, 2021 8:15 am

Hi!

IS there anyway to remove language correction or language detection in word document?


Thank you in advance!!

beatriz.gomezcarrero
 
Posts: 5
Joined: Mon May 24, 2021 7:51 am

Tue Jun 15, 2021 10:02 am

Hello,

Thanks for your inquiry.
In fact, this is a function of Microsoft Word, and has nothing to do with our products. But I searched online and found a solution: you can turn off spell checking by clicking:File->Options->Proofing-> When correcting spelling and grammar in word.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.Doc