Class Endnote (Word VBA)

The class Endnote represents an endnote. The Endnote object is a member of the Endnotes collection, which represents the endnotes in a selection, range, or document.

The main procedures of class Endnote are Delete and Endnotes.Add

Set

To use a Endnote class variable it first needs to be instantiated, for example

Dim end as Endnote
Set end = ActiveDocument.Range.Endnotes(Index:=1)

The following procedures can be used to set variables of type Endnote: Endnotes.Add, Endnotes.Item, Document.Endnotes, Range.Endnotes and Selection.Endnotes

For Each

Here is an example of processing the Endnote items in a collection.

Dim end As Endnote
For Each end In ActiveDocument.Range.Endnotes
	
Next end

Methods

These are the main methods of the Endnote class

Delete - Deletes the specified endnote.

ActiveDocument.Range.Endnotes(1).Delete

Endnotes.Add - Returns an Endnote object that represents an endnote added to a range.

Dim end As Endnote
Set end = ActiveDocument.Range.Endnotes.Add(Range:=)

Properties

Index returns a Long that represents the position of an item in a collection.

Dim lngIndex As Long
lngIndex = ActiveDocument.Range.Endnotes(1).Index

Parent returns an object that represents the parent object of the specified Endnote object.

Dim objParent As Object
Set objParent = ActiveDocument.Range.Endnotes(1).Parent

Range returns a Range object that represents the portion of a document that is contained in the specified object.

Dim rngRange As Range
Set rngRange = ActiveDocument.Range.Endnotes(1).Range

Reference returns a Range object that represents an endnote reference mark.

Dim rngReference As Range
Set rngReference = ActiveDocument.Range.Endnotes(1).Reference

Endnotes.ContinuationNotice returns a Range object that represents the endnote continuation notice.

Dim rngContinuationNotice As Range
Set rngContinuationNotice = ActiveDocument.Range.Endnotes.ContinuationNotice

Endnotes.ContinuationSeparator returns a Range object that represents the endnote continuation separator.

Dim rngContinuationSeparator As Range
Set rngContinuationSeparator = ActiveDocument.Range.Endnotes.ContinuationSeparator

Endnotes.Count returns a Long that represents the number of endnotes in the collection.

Dim lngCount As Long
lngCount = ActiveDocument.Range.Endnotes.Count

Endnotes.Location returns or sets the position of all endnotes. Read/write WdEndnoteLocation.

ActiveDocument.Range.Endnotes.Location = wdEndOfDocument

Endnotes.NumberingRule returns or sets the way endnotes are numbered after page breaks or section breaks.

ActiveDocument.Range.Endnotes.NumberingRule = wdRestartContinuous

Endnotes.NumberStyle returns or sets the number style.

ActiveDocument.Range.Endnotes.NumberStyle = wdNoteNumberStyleArabic

Endnotes.Parent returns an object that represents the parent object of the specified Endnotes object.

Dim objParent As Object
Set objParent = ActiveDocument.Range.Endnotes.Parent

Endnotes.Separator returns a Range object that represents the endnote separator.

Dim rngSeparator As Range
Set rngSeparator = ActiveDocument.Range.Endnotes.Separator

Endnotes.StartingNumber returns or sets the starting note number, line number, or page number.

ActiveDocument.Range.Endnotes.StartingNumber =