Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how can i get the colspan and rowspan value after merging some cells

234 views
Skip to first unread message

songq

unread,
Apr 8, 2003, 7:18:09 AM4/8/03
to
hi:
how can i get the colspan and rowspan value using VBA
after merging some cells in a table,i can hardly find any
properties in the word2000/xp object browser which can
generate such results.
About colspan:we can use ColSpan property to specify the
number of columns the cell occupies. This allows you
create a cell in the table that occupies more than one
column. For example, suppose you have a table that
contains two columns and two rows. You can create a table
heading cell that spans both columns. Set the ColSpan
property of the left-most cell in the first row to 2 to
indicate that this cell takes up two columns in the table.

Lutz Gentkow

unread,
Apr 8, 2003, 8:02:38 AM4/8/03
to
Hi Songq,

see this article:

"How to get the Rowspan and Colspan of a table cell using VBA"
=> http://www.mvps.org/word/FAQs/MacrosVBA/GetRowColSpan.htm

Greetings from Germany

Lutz, MVP Word/VBA

songq

unread,
Apr 9, 2003, 6:39:17 AM4/9/03
to
thank you!it seems to be an effective method to get the
rowspan value,but it is not enough to get the colspan
value,in the article,the authors mentions the following:
"There doesn't seem to be a straightforward way to
determine the number of columns that a merged cell spans.
But the best workaround seems to be as follows:
1. Calculate the total width of the table (in points).
2. Get the width of current cell in points.
3. Convert the cell width to a percentage of the table
width (eg 27%).
4. use <TD COLSPAN=27 WIDTH=27%>"
but that is not what i want to get,is there any else method
to get the colspan value?
>.
>
0 new messages