Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-04-2023, 05:17 PM
Wigi Wigi is offline Get only endnotes of selected text Windows 10 Get only endnotes of selected text Office 2019
Novice
Get only endnotes of selected text
 
Join Date: Jun 2019
Posts: 7
Wigi is on a distinguished road
Default Get only endnotes of selected text

Hello all,



I would like to programmatically loop through the endnotes that are part of the selected text in a Word document.

I can do that, but the code gives me ALL endnotes in the document. It seems to ignore the fact that I only want the endnotes from what text is selected (text contains the superscript index numbers).

Can anyone help please ? Thanks a lot !

In the screenshot, I selected 2 lines of text, still I get all my 327 endnotes of the active document. I would expect only a couple of endnotes in the Immediate window.

HTML Code:
Sub forum()

    Dim e                     As Endnote

    For Each e In Selection.Range.Endnotes
        Debug.Print e.Index
    Next

End Sub
Attached Images
File Type: png endnotes.PNG (5.3 KB, 10 views)
Reply With Quote
 

Tags
endnote reference

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get only endnotes of selected text Footnote formatting>"Apply changes to selected text" not limiting changes to selected text Swarup Word 11 07-26-2022 01:51 PM
Get only endnotes of selected text 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
Get only endnotes of selected text How to convert endnotes in a text doc to Word endnotes? Dickison Word VBA 4 10-06-2012 09:11 PM
Get only endnotes of selected text Separating endnotes from text kenglade Word 22 09-14-2012 04:10 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:27 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft