• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 84
  • Last Modified:

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
0
maxdbase
Asked:
maxdbase
  • 4
  • 2
1 Solution
 
GrahamSkanRetiredCommented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now