Tag: OpenXMLSDK
namespace OpenXMLDemo { class Program { static void Main(string[] args) { using (var package = WordprocessingDocument.Create( "test.docx", WordprocessingDocumentType.Document)) { MainDocumentPart mainDocumentPart1 = package.AddMainDocumentPart(); Document document1 = new Document(); Body body1 = new Body(); Paragraph paragraph1 = new Paragraph(); Run run1 = new Run(); run1.Append(new Text() { Text = "a+b=c" }); paragraph1.Append(run1); body1.Append(paragraph1); document1.Append(body1); mainDocumentPart1.Document = document1; } } } }