【问题标题】:retrieve footnote of word file with openxml使用openxml检索word文件的脚注
【发布时间】:2013-01-27 13:33:22
【问题描述】:

如何使用 open xml 在 c# 中检索 word 文件的所有脚注,我知道我们可以通过以下方式检索段落:

IEnumerable<Paragraph> paragraphs = mainPart.Document.Body.OfType<Paragraph>();

但是当我测试它的脚注时,我只得到 null,而我知道我的 word 文件中有一些脚注。

我刚刚找到这个页面来帮助我解决这个问题,但他们没有帮助我:

Footnotes constructor

如何获取所有脚注并将主题保存在列表中。

【问题讨论】:

    标签: c# openxml openxml-sdk office-2010


    【解决方案1】:

    获取脚注的示例:

    FootnotesPart footnotesPart = wordDoc.MainDocumentPart.FootnotesPart;
    if (footnotesPart != null)
    {
        IEnumerable<Footnote> footnotes = footnotesPart.Footnotes.Elements<Footnote>();
        ...
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多