テキストからDOCXを作成
テキストから新しいWordドキュメントを作成するのも簡単です。 段落、表、セクションなどのドキュメント構造オブジェクトを渡して、新しいWordドキュメントをインスタンス化します。 Finally, use the SaveAs method to export the document.
準備はできましたか?
Nuget ダウンロード 29,594 | バージョン: 2025.12 リリース
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");Install-Package IronWord
テキストから新しいWordドキュメントを作成するのも簡単です。 段落、表、セクションなどのドキュメント構造オブジェクトを渡して、新しいWordドキュメントをインスタンス化します。 Finally, use the SaveAs method to export the document.