using IronSoftware.Drawing;
using IronWord;
using IronWord.Models;
// Load docx
WordDocument doc = new WordDocument("document.docx");
// Configure text
Text textRun = new Text();
textRun.Text = "Add text using IronWord";
textRun.Style = new TextStyle()
{
FontFamily = "Caveat",
FontSize = 72,
TextColor = new IronColor(Color.Red),
IsBold = true,
IsItalic = true,
IsUnderline = true,
IsSuperscript = false,
IsStrikethrough = true,
IsSubscript = false
};
Paragraph paragraph = new Paragraph();
// Add text
paragraph.AddText(textRun);
// Add paragraph
doc.AddParagraph(paragraph);
// Export docx
doc.SaveAs("save_document.docx");
Imports IronSoftware.Drawing
Imports IronWord
Imports IronWord.Models
' Load docx
Private doc As New WordDocument("document.docx")
' Configure text
Private textRun As New Text()
textRun.Text = "Add text using IronWord"
textRun.Style = New TextStyle() With {
.FontFamily = "Caveat",
.FontSize = 72,
.TextColor = New IronColor(Color.Red),
.IsBold = True,
.IsItalic = True,
.IsUnderline = True,
.IsSuperscript = False,
.IsStrikethrough = True,
.IsSubscript = False
}
Dim paragraph As New Paragraph()
' Add text
paragraph.AddText(textRun)
' Add paragraph
doc.AddParagraph(paragraph)
' Export docx
doc.SaveAs("save_document.docx")