Skip to main content

AddFootnoteCrossRef

Adds a footnote cross-reference to the current paragraph. 💡 Please note that this paragraph must be in the document.

Syntax

expression.AddFootnoteCrossRef(sRefType, oParaTo, bLink, bAboveBelow);

expression - A variable that represents a ApiParagraph class.

Parameters

NameRequired/OptionalData typeDefaultDescription
sRefTypeRequiredfootnoteRefToThe text or numeric value of a footnote reference you want to insert.
oParaToRequiredApiParagraphThe first paragraph from a footnote to be referred to (must be in the document).
bLinkOptionalbooleantrueSpecifies if the reference will be inserted as a hyperlink.
bAboveBelowOptionalbooleanfalseSpecifies if the above/below words indicating the position of the reference should be included (don't used with the "aboveBelow" sRefType).

Returns

boolean

Example

This example adds a footnote cross-reference to the paragraph.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("This is just a sample text.");
doc.AddFootnote();
let footnotesFirstParagraphs = doc.GetFootnotesFirstParagraphs();
footnotesFirstParagraphs[0].AddText("Footnote 1");
paragraph = Api.CreateParagraph();
paragraph.AddText("For more information on previous sentences see footnote ");
doc.Push(paragraph);
paragraph.AddFootnoteCrossRef("formFootnoteNum", footnotesFirstParagraphs[0]);