Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to work with specific columns in a table

Status
Not open for further replies.

clhare

Technical User
May 29, 2003
118
US
I need to right justify the text in the 2nd thru last columns all but 2 tables in a document. How would I do that with a macro? There are 9 tables, but I want to skip tables 7 and 8.

Any help is greatly appreciated!

Cheryl
 
Tables have the Columns proberty and are members of the Tables collection. You can refer to them by item number: thisdocument.Tables(i), where i = 1-6, 9.

Then, for each of those, you can refer to the columns: thisdocument.Tables(i).Columns(j) where j = 2-thisdocument.Tables(i).Columns.Count.

I don't think you can set the Alignment property of a column, only of a row, so you'll have to refer to each cell in the column. That is, for a given column, it has a Cells property which in returns a Cells collection:
for each c in thisdocument.Tables(i).Columns(j).Cells
...


_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top