View Single Post
 
Old 03-06-2020, 03:09 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by marceepoo View Post
The Demo() macro did remove the preexisting bookmark "LastEntryThusFarMadeInTblOfExhibits", but did the macro did not create a new bookmark "LastEntryThusFarMadeInTblOfExhibits".
It does both in my testing.
Quote:
Originally Posted by marceepoo View Post
Your Demo() macro contained a lot of code that I do not understand ... because I do not understand how ranges work, and I have never found a tutorial explaining ranges (and how to use them) that I could understand enough to be able to use ranges.

I think your code between the line:
Do While .Find.Found
and the line:
If Not RngFnd Is Nothing Then .Bookmarks.Add Name:="LastEntryThusFarMadeInTblOfExhibits", Range:=RngFnd
was intended to do the following:
1. Create something analogous to a "selection point" at the place in the document where the search found the text "[FULLNAME: PDF] ", and
2. Create the new bookmark "LastEntryThusFarMadeInTblOfExhibits" at that new "selection point"
... or something like that.
What happens when using Find is that the range spanned by Rng actually moves to the found range.
Quote:
Originally Posted by marceepoo View Post
I would like the macro to insert the new bookmark "LastEntryThusFarMadeInTblOfExhibits" in column #1 on the first line of the next Heading 1 where the search found the text "[FULLNAME: PDF] " (i.e., the Heading 1 paragraph, where the search found the text "[FULLNAME: PDF] ", after the Heading 1 paragraph where the preexisting bookmark "LastEntryThusFarMadeInTblOfExhibits" had been, before it was deleted by the macro).
Well, that is rather different from what you previously described. I'll get back to you on that.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote