Link to home
Start Free TrialLog in
Avatar of Keith McElroy
Keith McElroy

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Keith McElroy
Keith McElroy

ASKER

That is a great start, thank you for helping me move forward.
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.
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.
Thanks a bunch, yes, I shall.   Have a great week!
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.