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.