Document.Endnotes Property (2007 System)

Gets an Endnotes collection that represents all the endnotes in the document.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property Endnotes As Endnotes
'Usage
Dim instance As Document 
Dim value As Endnotes 

value = instance.Endnotes
[BrowsableAttribute(false)]
public Endnotes Endnotes { get; }
[BrowsableAttribute(false)]
public:
property Endnotes^ Endnotes {
    Endnotes^ get ();
}
public function get Endnotes () : Endnotes

Property Value

Type: Endnotes
An Endnotes collection that represents all the endnotes in the document.

Examples

The following code example adds text to the first paragraph and then adds an endnote to the second word.

This example is for a document-level customization.

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 Security

See Also

Reference

Document Class

Document Members

Microsoft.Office.Tools.Word Namespace