Word文書の構築中にオブジェクトツリーを記録することで、開発者は重要なデバッグ洞察を得て検証ツールとし、ドキュメントの構造のエラーや不一致をすばやく特定および修正できます。 オブジェクトツリーの分析は、構築プロセスの非効率を特定して対処することで、開発者がパフォーマンス最適化を支援します。 全体として、オブジェクトツリーをログに記録することで、開発が合理化され、高品質のWordドキュメントを効率的に作成できるようになります。
IronWord チュートリアルでドキュメント要素を調べます。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();
Imports IronWord
Imports IronWord.Models
Imports System.Linq
Dim docx As New WordDocument("Table.docx")
' Log object tree of the whole document
docx.LogObjectTree()
' Log object tree of table 0
docx.Children.OfType(Of Table)().First().LogObjectTree()