Get Started
Usage API
More information

AddEndnoteCrossRef

AddEndnoteCrossRef(sRefType, oParaTo, [bLink], [bAboveBelow]) → { boolean }

Adds an endnote cross-reference to the current paragraph. The paragraph must be in the document.

Parameters:

Name Type Default Description
sRefType endnoteRefTo

The text or numeric value of an endnote reference you want to insert.

oParaTo ApiParagraph

The first paragraph from an endnote to be referred to (must be in the document).

bLink boolean true

Specifies if the reference will be inserted as a hyperlink.

bAboveBelow boolean false

Specifies if the above/below words indicating the position of the reference should be included (don't used with the "aboveBelow" sRefType).

Returns:

Type
boolean

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0); 
oParagraph.AddText("This is just a sample text.");
oDocument.AddEndnote();
var aEndNotesFirstParagraphs = oDocument.GetEndNotesFirstParagraphs();
aEndNotesFirstParagraphs[0].AddText("Endnote 1");
oParagraph = Api.CreateParagraph();
oParagraph.AddText("For more information on previous sentences see endnote on page ");
oDocument.Push(oParagraph);
oParagraph.AddEndnoteCrossRef("pageNum", aEndNotesFirstParagraphs[0]);
builder.SaveFile("docx", "AddEndnoteCrossRef.docx");
builder.CloseFile();

Resulting document