Aspose.Words.Document 希望可以在页眉中添加特定的文字,并将特定的文字做隐藏处理,并再次能用代码获取到隐藏的文字内容
请使用下面的代码示例隐藏标题的文本。
Document doc = new Document(MyDir + "in.docx");
foreach (Run run in doc.FirstSection.HeadersFooters[HeaderFooterType.HeaderPrimary].GetChildNodes(NodeType.Run, true))
{
run.Font.Hidden = true;
}
doc.Save(MyDir + "output.docx");