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

I'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?



          header 1a
          header 1b
          header 1c



  row 2a
          row 2b
          row 2c

  row 3a
  row 3b
  row 3c




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;
if (Selection.IsEqual(rng)) {
// cannot move row up
else {
// can move row up

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…