텍스트로부터 DOCX 생성
텍스트를 사용하여 새 Word 문서를 만드는 것도 간단합니다. paragraph, table 또는 section와 같은 문서 구조 객체를 전달하여 새로운 WORD 문서를 생성할 수 있습니다. 마지막으로, SaveAs 메서드를 사용하여 문서를 내보내십시오.
using IronWord;
using IronWord.Models;
// Create textrun
TextContent textRun = new TextContent("Sample text");
Paragraph paragraph = new Paragraph();
paragraph.AddChild(textRun);
// Create a new Word document
WordDocument doc = new WordDocument(paragraph);
// Export docx
doc.SaveAs("document.docx");
Imports IronWord
Imports IronWord.Models
' Create textrun
Private textRun As New TextContent("Sample text")
Private paragraph As New Paragraph()
paragraph.AddChild(textRun)
' Create a new Word document
Dim doc As New WordDocument(paragraph)
' Export docx
doc.SaveAs("document.docx")
Install-Package IronWord
텍스트를 사용하여 새 Word 문서를 만드는 것도 간단합니다. paragraph, table 또는 section와 같은 문서 구조 객체를 전달하여 새로운 WORD 문서를 생성할 수 있습니다. 마지막으로, SaveAs 메서드를 사용하여 문서를 내보내십시오.