Change the language dictionary of Word

Source: Internet
Author: User

Change Word's language Word Dictionary

See you last weekend.onAltarIt has been suggested that there is no way to useCodeChangeWord'slanguageWord dictionary,becauseto beTacitrecognizeof thelanguagewords will affectnowwithlanguagewords are enteredSpellWriteDeviceand other schoolstheTools. I checked it out on the Internet.nowSpire.docitaProductionProductssayitoursupport, exactlyFree tono matterso I'm using Spainlanguagedid it onceTest,KnotFruit HairnoweffectstillNowrong,let's share the followinghave testedProcess.

WholeeverProcessUseC #languagewords, inVS2012Ringunder the border,The version that Word uses is word2013, which isTestof thelanguagewords areSpanish in Peru,Locale ID Values are 10250. Full-Locale ID Values table, as you can seeMicrosoft Locale ID Values.

look at the third-party library of functions here:http://www.e-iceblue.com/Download/download-word-for-net-now.html, the version used is free Spire.doc for. NET version:5.2

The useful files that are needed are Spire.Doc.dll, placed in the downloaded extracted bin directory under the NET4.0 (you can choose different versions according to their needs).

Here's the official start!

First step: Add DLL file into project.

Open Our vs New Console program is enough, then right-reference->add reference then add Spire.Doc.dll file according to the.

Step Two: Add using . You need to add the following three manually.

usingSpire.doc;
usingSpire.Doc.Documents;
usingSpire.Doc.Fields;

Step Three: Establish new Word file, and initialize it. At the beginning of this step is adding code.

Document document =NewDocument ();
Section sec = document. AddSection ();
Paragraph para = sec. Addparagraph ();

Fourth step: In the created paragraph, add TextRange , and added a Spanish language.

TextRange Txtrange = para. AppendText ("corrige según Diccionario en volunteered");
TxtRange.CharacterFormat.LocaleIdASCII =10250;

Fifth step: Save the file and preview it.

Document. SaveToFile ("Result.docx", fileformat.docx2013);
System.Diagnostics.Process.Start ("Result.docx");

Preview results

As you can see, the language dictionary has been changed to the default language without notice . Peru Spanish up.

Change the language dictionary of Word

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.