//Creates new Word document. WordDocument wordDocument = new WordDocument(); //This method adds a section and a paragraph. wordDocument.EnsureMinimal(); //Appends the contents into the paragraph wordDocument.LastParagraph.AppendText("Dieses Word-Dokument wurde mit Syncfusion Essential DocIO erstellt."); //Sets language (German) for particular paragraph //You can also set language for each test ranges. wordDocument.LastParagraph.BreakCharacterFormat.LocaleIdASCII = (short)LocaleIDs.de_DE; //Save as DOCX format. wordDocument.Save("Sample.docx", FormatType.Docx); //Close document. wordDocument.Close(); |
//Creates new Word document. WordDocument wordDocument = new WordDocument(); //This method adds a section and a paragraph in the wordDocument.EnsureMinimal(); //Sets language for particular paragraph wordDocument.LastParagraph.BreakCharacterFormat.LocaleIdASCII = (short)LocaleIDs.de_DE; //Appends the contents into the paragraph IWTextRange textRange = wordDocument.LastParagraph.AppendText("Dieses Word-Dokument wurde mit Syncfusion Essential DocIO erstellt. "); //Sets language for particular text range. textRange.CharacterFormat.LocaleIdASCII = (short)LocaleIDs.de_DE; textRange = wordDocument.LastParagraph.AppendText("This Word document was created using Syncfusion Essential DocIO."); //Sets language for particular text range. textRange.CharacterFormat.LocaleIdASCII = (short)LocaleIDs.en_US; //Save as DOCX format. wordDocument.Save("Sample.docx", FormatType.Docx); //Close document. wordDocument.Close(); |