![]() |
#5
|
|||
|
|||
![]()
I need to run a function on all EndNotes in a specific bookmark in my document, and I am using the following stripped down code: Code:
Dim noteCount as integerDim eNote as EndNotenoteCount = oBookmark.Range.EndNotes.Count Debug.Print "Bookmark " & oBookmark.name & " has " & CStr(noteCount) & " EndNotes." if (noteCount > 0) Then For Each eNote in oBookmark.Range.Endnotes Debug.Print "EndNote #" & eNote.index Next eNoteend if When I run this on one of the bookmarks in my document, I get the correct NoteCount (e.g. 7), but the loop runs through ALL of the EndNotes in the document (e.g. I get 42 lines of 'EndNote #X') Is this a bug, the fact that oBookmark.Range.EndNotes.Count lists 7, but when I loop through the oBookmark.Range.EndNotes collection, I get 42 EndNotes, or is there an error in my code? If this is a bug, is there something I can do to work around this? I tried to check eNote.Range.Bookmarks and eNote.Range.BookmarkID to verify that the EndNote belongs to the current bookmark, but I'm getting a '0' for both eNote.Range.BookmarkID & eNote.Range.Bookmarks.Count ![]() I'm running Word 2007, if that matters. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to index words in endnotes | ClaireB | Word | 1 | 11-11-2013 06:05 PM |
![]() |
Dickison | Word VBA | 4 | 10-06-2012 09:11 PM |
![]() |
kenglade | Word | 22 | 09-14-2012 04:10 PM |
![]() |
elias | Word | 12 | 09-04-2012 04:12 PM |
![]() |
kenglade | Word | 4 | 12-03-2011 01:26 PM |