Home › Forums › General XMetaL Discussion › Moving Rows and Columns for CALS Table › Reply To: Moving Rows and Columns for CALS Table
Reply to: Moving Rows and Columns for CALS Table
April 8, 2013 at 6:35 pmI'm not sure I understand your steps 3 and 4. When you talk about moving the range backwards, do you mean using ActiveDocument.Range.MoveUp()? Do I need to move up more than once to check if it has a row above the current selection or will MoveUp always go to the previous row, even if the selection is in the top most tbody row (row 2a in my example) and the table has a header?
[code]
[/code]
I'm also unsure about what you mean for checking that previousSibling is also a row. Could you provide an example?
I have something like this:
[code]var rng = ActiveDocument.Range;
rng.MoveUp();
if (Selection.IsEqual(rng)) {
// cannot move row up
else {
// can move row up
}[/code]
I was hoping that rng.MoveUp() would stay put when the selection is in “header 1a” in my example, but it still seems to change so this code always falls into the else…