1
我想知道如何確定段落是否有隱藏文字。通過互操作很容易,但我似乎無法在openxml中找到它。任何幫助是極大的讚賞C#OpenXML確定段落是否隱藏文字
MainDocumentPart mdp = wordprocessingDocument.MainDocumentPart;
XDocument xDoc = mdp.GetXDocument();
IEnumerable<XElement> = xDoc.Descendants(W.p);
foreach (var paragraph in paragraphs)
{
// I want to check if this paragraph has hidden text or not, if it does I want to skip over it.
// if (paragraph.hasHiddenText()) { continue; }
// else, get the content
string paraText = paragraph.Descendants(W.t).Select(t => (String)t).StringConcatenate();
}
您是否嘗試使用一些隱藏文本創建文檔,然後解壓縮該文件並查看它是如何生成的? – Crowcoder