跳到主要内容

AddFootnoteCrossRef

向当前段落添加脚注交叉引用。 💡 请注意,此段落必须在文档中。

语法

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

expression - 表示 ApiParagraph 类的变量。

参数

名称必需/可选数据类型默认值描述
sRefType必需footnoteRefTo要插入的脚注引用的文本或数值。
oParaTo必需ApiParagraph要引用的脚注的首段(必须在文档中)。
bLink可选booleantrue指定引用是否作为超链接插入。
bAboveBelow可选booleanfalse指定是否应包含表示引用位置的“上方/下方”字样(不与 “aboveBelow” sRefType 一起使用)。

返回值

boolean

示例

在文档的段落中插入对脚注的交叉引用。

// How do I reference a footnote from within paragraph text in a document?

// Point readers from body text to a specific footnote number so they can find source details in a document.

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]);