Tables

A

Andy Newland

Hi,

I have a table in a document that I want to programmatically
hide/show depending on certain circumstances. I can o this
by looping throuh the table rows and setting the height
attribute.

This works OK but I have a problem. I can't set a row to
have a height of 0. This means I have to set the height to 1.
The problem with this is that it leaves a very small gap
where the 'hidden' row. If there are enough hidden rows next
to each other this leaves a large bit of white space in the
doc.

Is there a way I can hide the table row so it becomes
completely invisable?

Thanks for any help

Andy

PS - I don't want to delete as I have different bookmarks in
the rows and these will be hard to re-add.
 
H

Helmut Weber

Hi Andy,

e.g.
select the table.

With Selection.Font
.Hidden = True
End With

hides not only the text in the table,
but the entire table.
Same applies to rows in a table.

You may use range instead of selection:

With ActiveDocument.Tables(1).Range
.Font.Hidden = True
End With

Greetings from Bavaria, Germany

Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
 

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