Word VBA - marking a range for frequent searching

Working with a large document (up to 10,000 paragraphs)  I'll need to define a range to frequently Find certain blocks of text within it. This is so that the TOC and Indexes are excluded in the Find.

So I'm looking for the most efficient way to mark the beginning and end of this range in the document template. The choices I can think of are (1) a unique text marker (eg. ZZZBEGIN) as hidden text or (2) a Field?
Is there better way?
A build-in feature for defining a block of text, that is saved in the document template as 'a marker'?

So that I can select in VBA like
(pseudocode)
Set myRange = oDoc.Markers("TheMarker")

Thanks
hindersalivaAsked:
Who is Participating?
 
GrahamSkanRetiredCommented:
That's what bookmarks are for
Dim bmk As Bookmark
Set bmk = odoc.Bookmarks.Add("TheMarker", myRange)

Open in new window

0
 
GrahamSkanRetiredCommented:
To use later:
Set myRange = oDoc.Bookmarks("TheMarker")

Open in new window

0
 
hindersalivaAuthor Commented:
Thanks Graham. Of course!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.