IRONSOFTWAREHOME
從文字建立 DOCX 檔案
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
Dim textRun As New TextContent("Sample text")

Dim paragraph As New Paragraph()
paragraph.AddChild(textRun)

' Create a new Word document
Dim doc As New WordDocument(paragraph)

' Export docx
doc.SaveAs("document.docx")
NuGet Download
PM > Install-Package IronWord
從文字建立 DOCX 檔案

從文字建立 DOCX 檔案

從文字建立新的Word文件也很簡單。 傳遞任何文件結構物件,例如section,以實例化新的Word文件。 最後,使用SaveAs方法匯出文件。

探索IronWord的文件元素教程
在 GitHub 上查看

準備開始了嗎?

Nuget Downloads 58,016版本:2026.10剛剛發布

Key in blue circle

立即免費取得 30 天試用金鑰。

Your trial license will be sent to your email address

無任何限制。100% 解鎖。無需信用卡。

bullet_checked無需信用卡或建立帳號無任何限制。100% 解鎖。無需信用卡。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronWord
預約您的免費現場演示
Booking Badge

全球數百萬工程師信賴

Iron Software的客戶標誌
獲取您的無義務諮詢
您的詳細資訊將始終保持機密。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
全球數百萬工程師信賴
立即獲取您的30天試用金鑰。
無需信用卡或帳戶建立
C# PDF的NuGet程式庫
通過NuGet安裝

版本: 2026.10

PM > Install-Package IronWord
nuget.org/packages/IronWord/
  1. 在方案總覽中右鍵點擊引用,管理NuGet包
  2. 選擇Browse並搜尋“IronWord”
  3. 選擇套件並安裝
C# PDF DLL
下載DLL

版本: 2026.10

  1. 下載並解壓IronWord到如~/Libs的目錄中
  2. 在Visual Studio方案總覽中右鍵點擊引用。選擇Browse,“IronWord.dll”

授權從$999