DocumentBase.Endnotes 屬性

取得 Endnotes 集合,表示文件中的所有章節附註。

命名空間:  Microsoft.Office.Tools.Word
組件:  Microsoft.Office.Tools.Word.v4.0.Utilities (在 Microsoft.Office.Tools.Word.v4.0.Utilities.dll 中)

語法

'宣告
Public ReadOnly Property Endnotes As Endnotes
    Get
public Endnotes Endnotes { get; }

屬性值

型別:Microsoft.Office.Interop.Word.Endnotes
Endnotes 集合,表示文件中的所有章節附註。

範例

下列程式碼範例會將文字加入至第一個段落,然後將章節附註加入至第二個字。 若要使用這個範例,請在文件層級專案中的 ThisDocument 類別執行。

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

}

.NET Framework 安全性

請參閱

參考

DocumentBase 類別

Microsoft.Office.Tools.Word 命名空間