Pedro, from the given
details, we have found that your requirement is to set the proofing language to
text in the Word document. To achieve your requirement, we suggest you to set the
required language (LocaleIDs)
in the LocaleIdASCII
property of the text character format as shown below,
//Creates
a new Word document.
using (WordDocument document = new WordDocument())
{
//Add new section to the document.
IWSection section =
document.AddSection();
//Add new paragraph to the section.
IWParagraph paragraph =
section.AddParagraph();
//Add new text to the paragraph.
IWTextRange text = paragraph.AppendText("This is the first text range.
");
//Set language
identifier.
text.CharacterFormat.LocaleIdASCII = (short)LocaleIDs.pt_PT;
//Creates file stream.
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"../../../Result.docx"), FileMode.Create, FileAccess.ReadWrite))
{
//Saves the Word document to file stream.
document.Save(outputFileStream,
FormatType.Docx);
}
}
|
We have prepared the sample application to set
the Portuguese as a proofing language to text in the Word document and it can
be downloaded from the below attachment.
Refer our UG documentation to know more about working with text in the Word
document,
https://help.syncfusion.com/file-formats/docio/working-with-paragraph#working-with-text
If this post is
helpful, please consider accepting it as the solution so that other members can
locate it more quickly.
Attachment:
Setproofinglanguage_57789fe3.zip