Pages: 1
Print
Author Topic: Modify selected elements?  (Read 384 times)
queshaw
Member

Posts: 10


« on: April 11, 2019, 03:17:49 PM »

I need to write a macro/script/program that alters the XML that the user has selected. In this case, the selection is expected to contain OASIS table rows. How can I find what is "selected", i.e. elements that are highlighted after the user dragged a selection with the mouse?

I read 2 posts roughly asking the same question. One answer uses IsInsertionPoint and suggests moving ranges around, but I have no idea how that would tell me what elements are highlighted.

Another post uses Duplicate and Collapse, but when I try that it does not give me the elements that are highlighted by the user. Or, it gives me the parent of the elements that are highlighted, neither of which tell me what is highlighted. How can I do this?

Kendall
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2618



WWW
« Reply #1 on: April 15, 2019, 12:58:55 PM »

See my reply here, third in the thread:

http://forums.xmetal.com/index.php/topic,4037.0.html

The two relevant APIs are:
Selection.IsMultiCellSelection
Selection.Cells

If you can provide more information about what you need to accomplish I might be able to suggest something in more detail. Keep in mind that the actual end result (and starting condition) is the most important thing here as sometimes you can get there multiple ways.
« Last Edit: April 15, 2019, 02:01:41 PM by Derek Read » Logged
queshaw
Member

Posts: 10


« Reply #2 on: April 16, 2019, 09:38:53 AM »

Thank you!

Ultimately, I want to set an attribute on rows within the selection.

Kendall
« Last Edit: April 16, 2019, 09:46:58 AM by queshaw » Logged
Pages: 1
Print
Jump to:  

email us