DocumentBase.Endnotes 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取一个 Endnotes 集合,该集合表示文档中的所有尾注。
public Microsoft.Office.Interop.Word.Endnotes Endnotes { get; }
属性值
一个 Endnotes 集合,表示文档中的所有尾注。
示例
下面的代码示例向第一个段落添加文本,然后将尾注添加到第二个单词。 若要使用此示例,请在 ThisDocument 文档级项目的类中运行它。
private void DocumentEndnotes()
{
object text = "Sample endnote text.";
this.Paragraphs[1].Range.InsertParagraphAfter();
this.Paragraphs[1].Range.Text = "This is sample paragraph text.";
this.Endnotes.Location = Word.WdEndnoteLocation.wdEndOfDocument;
this.Endnotes.NumberStyle = Word.WdNoteNumberStyle.wdNoteNumberStyleLowercaseRoman;
this.Endnotes.Add(this.Paragraphs[1].Range.Words[2].Characters[2], ref missing, ref text);
}
Private Sub DocumentEndnotes()
Dim text As Object = "Sample endnote text."
Me.Paragraphs(1).Range.InsertParagraphAfter()
Me.Paragraphs(1).Range.Text = "This is sample paragraph text."
Me.Endnotes.Location = Word.WdEndnoteLocation.wdEndOfDocument
Me.Endnotes.NumberStyle = Word.WdNoteNumberStyle.wdNoteNumberStyleLowercaseRoman
Me.Endnotes.Add(Me.Paragraphs(1).Range.Words(2).Characters(2), , text)
End Sub