日志对象树
using IronWord;
using IronWord.Models;
using System.Linq;

WordDocument docx = new WordDocument("Table.docx");

// Log object tree of the whole document
docx.LogObjectTree();

// Log object tree of table 0
docx.Children.OfType<Table>().First().LogObjectTree();
NuGet Download
PM > Install-Package IronWord
日志对象树

日志对象树

在构建Word文档过程中记录对象树,提供开发者必要的调试见解和验证工具,使他们能够快速识别并纠正文档结构中的错误或不一致之处。 通过分析对象树,可以帮助开发人员识别和解决构建过程中的低效问题,从而有助于性能优化。 总而言之,记录对象树可以简化开发流程,确保高效创建高质量的 Word 文档。

通过 IronWord 教程探索文档元素。
在 GitHub 上查看

准备开始了吗?

Nuget Downloads 61,140版本:2026.11刚刚发布