Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

jquery-like closest property in Microsoft Word?

Posted on 2016-09-12
6
Medium Priority
?
81 Views
Last Modified: 2016-09-12
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
Comment
Question by:maxdbase
  • 4
  • 2
6 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 2000 total points
ID: 41794958
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
 

Author Closing Comment

by:maxdbase
ID: 41794961
That is a great start, thank you for helping me move forward.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 41794964
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 76

Expert Comment

by:GrahamSkan
ID: 41794970
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
 

Author Comment

by:maxdbase
ID: 41794974
Thanks a bunch, yes, I shall.   Have a great week!
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 41794985
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to show you some basics you can do with Mailings in MS Word. It´s quite handy feature you can use for creating envelopes, labels, personalized letters etc. First question could be what is this feature good for? Mailing can really he…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question