![]() |
|
|
|
#1
|
|||
|
|||
|
I just created this as I see that Macropod already answered you. So here's my attempt in case it helps.
This method checks that each marker text is within your selection range, and if so, prints the endnote number. Code:
Sub selectedEndnotes()
' Loop through selected endnotes.
Dim eNotes As Endnotes
Dim eNote As Endnote
Dim rng_selected As Range
Dim rng_marker As Range
Set eNotes = ActiveDocument.Endnotes
Set rng_selected = Selection.Range
' If nothing is selected, show a message
If rng_selected.Start = rng_selected.End Then
MsgBox "Please make a selection."
End If
Debug.Print ("The following endnotes are in selection:")
For Each eNote In eNotes
Set rng_marker = eNote.Reference.Characters.First ' Get marker range
' Only process endnotes whose marker .Start is between selection range.
If rng_marker.Start >= rng_selected.Start And rng_marker.End <= rng_selected.End Then
' ---- Do whatever you're going to do to each endnote here. ---
Debug.Print (eNote.Index)
End If
Next eNote
End Sub
|
|
#2
|
|||
|
|||
|
Quote:
|
|
| Tags |
| endnote reference |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Footnote formatting>"Apply changes to selected text" not limiting changes to selected text
|
Swarup | Word | 11 | 07-26-2022 01:51 PM |
Find and Replace Selected Text or Macro for finding selected text
|
mrplastic | Word VBA | 4 | 12-20-2019 01:25 PM |
| Powerpoint-2019 Text in selected theme remains in All Caps even when small caps option is selected | Tanasha4 | PowerPoint | 2 | 04-06-2019 07:53 PM |
How to convert endnotes in a text doc to Word endnotes?
|
Dickison | Word VBA | 4 | 10-06-2012 09:11 PM |
Separating endnotes from text
|
kenglade | Word | 22 | 09-14-2012 04:10 PM |