Hi Peter Henry
This is possible through the paragraphs
property. You can iterate through the paragraphs and check if each paragraph is part of a footnote, then extract the index.
// Run a batch operation to access the document Word.run(async (context) => { // Get the paragraphs in the document let paragraphs = context.document.body.paragraphs; // Load the paragraphs and footnotes paragraphs.load("items,items/footnoteOrNull"); await context.sync(); // Iterate through the paragraphs and check for footnotes paragraphs.items.forEach((paragraph, index) => { let footnote = paragraph.footnoteOrNull; if (footnote.isNullObject) { // The paragraph is not part of a footnote } else { // The paragraph is part of a footnote console.log("Paragraph at index " + index + " is part of footnote with ID: " + footnote.id); } }); });
Kindly accept the answer if this helps thanks much.