Multiple Row Header

T

Terry Moriarty

Is there a way to select multiple rows in a table (rows 1 -
3) and set them as the header?

I've tried selecting the table when only these rows are in
the table, but that didn't work.

Thanks,
Terry Moriarty
 
D

Dave Lett

Hi Terry,

With the table spanning more than one page, select the rows you want to use
as the header.
On the Table menu, click Heading Rows Repeat.
For Word 97, do the same, but click Headings on the Table menu.

HTH,
Dave
 
G

Guest

Sorry. I left out some inportant requirements. I meant
within VBA.

Thanks
Terry Moriarty
 
P

Peter Hewett

Hi <[email protected]>

Try the following code:
ActiveDocument.Tables(1).Rows.HeadingFormat = True

This sets the first 3 rows of table 1 as repeating header rows. Just change the
"1" in the above example to the number of the table you wish to modify.

HTH + Cheers - Peter
 
T

Terry Moriarty

This didn't work either.

In tracing through the code, the three rows are selected
when this line of code executes and the Heading Row Repeat
toggle gets set. But the heading doesn't get repeated
when the table spans the page.

Any ideas?

Thanks,
Terry
 
P

Peter Hewett

Hi Terry Moriarty

Problem determination time. If you manually set the first three rows of the
first table in your document does that work?

If the above does work, check that the table index number in the code is
correct. Also make sure that what you see as one table really is one table.

HTH + Cheers - Peter
 
T

Terry Moriarty

"If you manually set the first three rows of the
first table in your document does that work?"

Yes

"If the above does work, check that the table index number
in the code is correct."

Yes. I walk through the code as it is executing and see
that the right table is being selected. In fact, it
doesn't work for the first table.

"Also make sure that what you see as one table really is
one table."

Not sure what you mean by this. Each table is distinct
from one another with a caption before each one.

Thanks for helping me out,
Terry
 
D

Dave Lett

Hi Terry,

The only problem that I see with

ActiveDocument.Tables(1).Rows.HeadingFormat = True

is that it doesn't specify which rows. You might try the following:

Dim oRng As Range
With ActiveDocument.Tables(1)
Set oRng = ActiveDocument.Range _
(Start:=.Rows(1).Range.Start, _
End:=.Rows(3).Range.End)
End With
oRng.Rows.HeadingFormat = True

HTH,
Dave
 

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