BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
//Creates a new Word document
WordDocument document = new WordDocument();
//Add one section and one paragraph
document.EnsureMinimal();
//Get the last paragraph.
WParagraph paragraph = document.LastParagraph as WParagraph;
paragraph.AppendText("Symbol using character code : ");
//Append fraction symbol using its character code.
paragraph.AppendText("\u00BD");
//Add paragraph into the Word document
paragraph = document.LastSection.AddParagraph() as WParagraph;
paragraph.AppendText("Custom formula using Equation field ");
//Append equation field
WField field = paragraph.AppendField("EQ", FieldType.FieldExpression) as WField;
//Set field code to preserve fractions
field.FieldCode = "EQ \\f(2,3)";
//Saves and closes the Word document
document.Save("Sample.docx");
document.Close();
|
//Creates a new Word document
WordDocument document = new WordDocument();
//Add one section and one paragraph
document.EnsureMinimal();
//Get the last paragraph.
WParagraph paragraph = document.LastParagraph as WParagraph;
//Append fraction symbol using its character code.
paragraph.AppendText("1/2" + " " + "\u00BD");
WTextRange text = paragraph.ChildEntities[0] as WTextRange;
//Sets the size for the text
text.CharacterFormat.FontSize = 12;
//Saves and closes the Word document
document.Save("Sample.docx");
document.Close();
|