Determining number of columns in a row of a word table using VBS

R

Ruby Tuesdays

I'm scratching my head trying to find out what method I should use to find
the number of columns in a row of a word table. Thanks
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

MsgBox Selection.Rows(1).Cells.Count

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 
R

Ruby Tuesdays

Thanks, where do you find those information?

Will the command work if the table has mixed-width-cells(some with merge
cell and some with different size of column-widths)? How do you fix this
programatically e.g:

If Selection.Rows(1).Cells.Count = xxx then [ process the row]
Else IGNORE, move on to the next rows.

Thanks

"Doug Robbins - Word MVP - DELETE UPPERCASE CHARACTERS FROM EMAIL ADDRESS"
 
R

Ruby Tuesday

After a few hours searching for the answer on the net, I finally figure it
out.

So far, the only way to do it is to just walk thru the cells on by one using
index. Otherwise the colum object will give you mixed-width-cells error.

Ruby Tuesdays said:
Thanks, where do you find those information?

Will the command work if the table has mixed-width-cells(some with merge
cell and some with different size of column-widths)? How do you fix this
programatically e.g:

If Selection.Rows(1).Cells.Count = xxx then [ process the row]
Else IGNORE, move on to the next rows.

Thanks

"Doug Robbins - Word MVP - DELETE UPPERCASE CHARACTERS FROM EMAIL ADDRESS"
MsgBox Selection.Rows(1).Cells.Count

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top