Home Forums General XMetaL Discussion Moving Rows and Columns for CALS Table Reply To: Moving Rows and Columns for CALS Table

Derek Read

Reply to: Moving Rows and Columns for CALS Table

There are no APIs that let you ask “Can the current row be moved up?” (etc…) so I think you will need to implement some logic based on the current user's selection in this case.

This type of logic would probably do it:
1. Create a Range from ActiveDocument.Selection.
2. Check to see if the Range is inside a table using InContextOfType. If it is true then continue, otherwise everything should be disabled (or you should have already checked this before even launching your own dialog)…
3. Move the Range backwards (or into the parent depending on which APIs you prefer) until you get to a row.
4. Check to see if the selection has a previousSibling that is also a row (that's a DOM call so you'd need to also convert the Range to a node to use that, otherwise you could continue moving the Range but I think using previousSibling is probably better).

Reply

Products
Downloads
Support