Add Text
The code snippet above imports an existing Word document, then adds the text 'Add text using IronWord' to the document using the AddText
method. Finally, the modified document is exported.
using IronWord; using IronWord.Models; // Load docx WordDocument doc = new WordDocument("document.docx"); // Add text doc.AddText("Add text using IronWord"); // Export docx doc.SaveAs("save_document.docx");
Imports IronWord Imports IronWord.Models ' Load docx Private doc As New WordDocument("document.docx") ' Add text doc.AddText("Add text using IronWord") ' Export docx doc.SaveAs("save_document.docx")
Install-Package IronWord
The code snippet above imports an existing Word document, then adds the text 'Add text using IronWord' to the document using the AddText
method. Finally, the modified document is exported.
9 .NET API products for your office documents