jquery-like closest property in Microsoft Word?

I am automating Microsoft Word documents using the following structure

bookmark
h3 header
  table
      row
         cell
             Range.Text

Are there any properties or functions already available that would allow a statement such as the following or at least be usable to achieve
that capability?

myvar = mycell.closest("bookmark").find(h3).text
maxdbaseAsked:
Who is Participating?
 
GrahamSkanConnect With a Mentor RetiredCommented:
No, You would have to break it down to your precise requirements and write the code accordingly.

A Bookmark object has a Range property. A Range has a Start and an End property, so it would be possible to find another object with a Range property that is the nearest to the Start or to the End of the Bookmark Range
0
 
maxdbaseAuthor Commented:
That is a great start, thank you for helping me move forward.
0
 
GrahamSkanRetiredCommented:
Note that in the case of defining the nearest for a table cell, it would be necessary to distinguish between the nearest cell in terms of the table, and the nearest in terms of the amount of separating text.
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
GrahamSkanRetiredCommented:
Thanks. If you need any more help with details later on, please post another question, Hopefully I, or another expert, will be able to assist.
0
 
maxdbaseAuthor Commented:
Thanks a bunch, yes, I shall.   Have a great week!
0
 
GrahamSkanRetiredCommented:
Oops. I've now looked up what 'closest' means in Jquery. I see that it means traversing upwards in a hierarchy to find a match, so many of many the details in my comments are not applicable.
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.