Solved

jquery-like closest property in Microsoft Word?

Posted on 2016-09-12
6
28 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 500 total points
Comment Utility
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
Comment Utility
That is a great start, thank you for helping me move forward.
0
 
LVL 76

Expert Comment

by:GrahamSkan
Comment Utility
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 76

Expert Comment

by:GrahamSkan
Comment Utility
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
Comment Utility
Thanks a bunch, yes, I shall.   Have a great week!
0
 
LVL 76

Expert Comment

by:GrahamSkan
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
This is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used.  One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to…
This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.

771 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now