I'm trying to iterate through a Word document and extract the footnotes out of it, with a reference to where they belong in the paragraph.
I'm not sure how to do this.
I saw that in order to get all the footnotes I can do something like this:
FootnotesPart footnotesPart = doc.MainDocumentPart.FootnotesPart;
if (footnotesPart != null)
{
IEnumerable<Footnote> footnotes = footnotesPart.Footnotes.Elements<Footnote>();
foreach (var footnote in footnotes)
{
...
}
}
However, I don't know how to know where each footnote belongs in the paragraph.
I want, for instance, to take a footnote, and put it in brackets inside the text where it was a footnote before.
How do I do this?