A
Alex
Hello,
Here's a problem that got me puzzled
Let's say I have a range.
I find the last character:
last = range.Characters.Last
I do some stuff and then I try to insert something in front of it:
last.InsertBefore("x")
But, if my range exactly encompassed a table, the last character will be at the end of the row and it will fail with the jolly message:
"This is not a valid action for the end of the row".
OK, I'll test for it. At the end of the column I have:
last.Text == "\r\a" (2 characters actually but that's fine).
Problem solved? Not exactly.
The same value is returned if my range encompasses just one cell, and in that case the insertion will succeed.
So, my question is: how do I distinguish between the end of a row and the end of a cell?
Any ideas?
Best wishes,
Alex.
Here's a problem that got me puzzled
Let's say I have a range.
I find the last character:
last = range.Characters.Last
I do some stuff and then I try to insert something in front of it:
last.InsertBefore("x")
But, if my range exactly encompassed a table, the last character will be at the end of the row and it will fail with the jolly message:
"This is not a valid action for the end of the row".
OK, I'll test for it. At the end of the column I have:
last.Text == "\r\a" (2 characters actually but that's fine).
Problem solved? Not exactly.
The same value is returned if my range encompasses just one cell, and in that case the insertion will succeed.
So, my question is: how do I distinguish between the end of a row and the end of a cell?
Any ideas?
Best wishes,
Alex.