![]() |
#3
|
|||
|
|||
![]()
Sorry for my delay in responding. I figured out what was wrong, via a lot of time. When I rebooted, I could not get this code to work. But when I manually showed bookmarks (ctrl-shift-F5, choose "hidden bookmarks"), then the code worked fine. I had to add this code before any bookmark manipulation:
Code:
ActiveDocument.Bookmarks.ShowHidden = True Then the code works fine. Andrew, thank you for the comment. I am doing something probably no one does. I have some numbered paragraphs with cross references in them. I copy this text, put the cursor below it, then I want to put a modified version of this code there, with updated bookmarks/cross-references, then put yet another modified version of this code there, with yet further updated bookmarks/cross-references. What I do is copy the text to a new document, change the bookmarks/cross-references, change the text, go to the bottom of the new document, paste the original text in again, change the bookmarks/cross-reference, manipulate it in a different way, then paste all the text in the new document back to the insertion point. If you have suggestions about a better way to loop through bookmarks from the start and removing+adding bookmarks while you are doing it, I'm open to suggestions. This code does work, and in my debugging, I went through it line-by-line to see exactly what it did. But I'm always open for suggestions of something better/less likely to cause error/better programming techniques, etc. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Training | Word VBA | 1 | 11-09-2017 12:06 AM |
Where to put Subroutine to make sure bookmarks aren't deleted so cross-references work | mrsjetset | Word VBA | 5 | 06-29-2016 05:06 PM |
Convert manual cross references in footnotes to other footnotes to automatic cross references | ghumdinger | Word VBA | 7 | 11-20-2014 11:47 PM |
![]() |
Suchoklates | Word | 1 | 09-19-2013 02:32 AM |
Bookmarks with different figure references | Dan_68 | Word | 0 | 02-15-2010 08:29 PM |