Page 1 of 1

Cannot format Ranges (part 2)

Posted: Tue Aug 18, 2015 10:17 am
by obeltrami
Hello,

I am returning to the topic of conversion of Formatting Ranges from v.4 to v.5, which remained open when you left on holidays in June. I have spent most of the past 6 weeks adapting the code that used to format with "Range.Items[]" to use "CmdFormat". What a nightmare !!! Each single line now becomes 4 or more lines of code.

Still, I am getting the knack of converting the code to v.5 for text. However, I am still having problems with cell borders.

1) There seems to be an "off by one" bug in the code that manages Border.Side[] as the formatting is always applied to the previous column or previous row than the one specified.

2) Most importantly, I cannot find a way to set, for example, the right side of a range of cells. If I use cbspOutline it does the right side OK, but damages the right side of the range on the left. If I try cbspNone then nothing happens. How can I get the same result under v.5 as I was getting under v.4 for

Code: Select all

Range.Items[bufCol,minRow,bufCol,maxRow].BorderRightStyle := cbsThin;
for example, and not have other borders be changed ?

Very best regards,

Olivier

Re: Cannot format Ranges (part 2)

Posted: Wed Aug 19, 2015 6:51 am
by larsa
Hello

Can you please create a small sample that reproduces the problem?

Re: Cannot format Ranges (part 2)

Posted: Wed Aug 19, 2015 8:50 am
by obeltrami
OK, I'll put something together later today or tomorrow.

Re: Cannot format Ranges (part 2)

Posted: Wed Aug 19, 2015 12:09 pm
by obeltrami
I just sent you the sample project by email.