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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word 2003/2007: Repeat header rows question

Status
Not open for further replies.

BrianWen

Programmer
Jun 8, 2009
102
DK
Quick question: Is there any way to indicate (format) the "real" header row, so it is easier to spot. I have some long documents with many tables, that look the same and some of them spans pages, and therefore have repeating header rows. But it's confusing to look at.

I guess there is no way, but it doesn't hurt asking :)
 
Hi Brian,

You could simply shade the header row(s) for each table differently fromn the one before/after. Obviously, that shading will repeat on each page that the header repeats on, ans the 'true' header row as you call it can only exist at the logical top of the table, but that shouldn't be too difficult to recognise.


Cheers
[MS MVP - Word]
 
If you control+G to bring up the Goto dialog and highlight table in the listbox the Previous and Next buttons will move you to the top of each table.
 
Thanks for the suggestions. Both are a bit hard to implement/use in this case, mainly because the entire document gets created by a hefty VBA script and it's supposed to be printed (it's a Curriculum Vitae).

But I will consider the shading thing. Thanks to both of you...
 
Both are a bit hard to implement/use in this case,"

I do not see why. As macropod mentions, the repeating header row is the first row - or rows - of the table. It MUST include the first row(s). Therefore simply format the row(s) you are using for repeat as you want them, and then set the repeat. This is not a hard implementation.
Code:
With ActiveDocument.Tables(1).Rows(1)
    .Shading.Texture = wdTexture20Percent
    .HeadingFormat = wdToggle
End With
shades the first row of table(1), and then makes that row the repeating header.

If you need to use more than one row as the repeating header row, then one way (there are other ways) is:
Code:
Dim r As Range
Set r = ActiveDocument.Range( _
    Start:=ActiveDocument.Tables(1).Rows(1).Range.Start, _
    End:=ActiveDocument.Tables(1).Rows(2).Range.End)
With r
    .Shading.Texture = wdTexture20Percent
    .Rows.HeadingFormat = wdToggle
End With
This makes a range object of the first two rows of table(1), and then formats those rows, and then uses them for the repeating header.

Unless you have something very odd going on, it should not be difficult to incorporate a different format for the rows you want to use for repeating header rows. It should not be affected by any "hefty" VBA code, nor by the issue of printing. In fact, I do not see any issue with printing at all. Why do you think that printing may be a factor?

Gerry
 
mintjulep suggested: "If you control+G to bring up the Goto dialog and highlight table in the listbox the Previous and Next buttons will move you to the top of each table."

That is not easy with a printed document. That's what I meant.


With regards to the shading. I'm not referring to difficulty in coding it. It might acutally be a fine solution, the more I think about it.
The solution I was wishing for (but doubt is possibly) is that each time an entirely new table is starting, the header row is shaded (or formatted differently otherwise) and repeating header rows in the table are not shaded. So there would not be a shaded row before next table starts.

That is exactly what the users are requesting, but I guess it's not possible!? - If not, I will suggest the shading proposal.
 
You are asking contradictions.

The heading rows as defined for a table is repeated as it is. Therefore you can NOT have a shaded heading row and have later repeated heading not be shaded. Repeated rows are, well, repeated. They are identical to the starting one(s). For each table that is of course.

Now, it seems you are asking about having DIFFERENT formats for consequtive tables. Yes?

Say Table1's heading rows shaded (say) 20%, Table2 shaded 30%, Table3 colored red...whatever.

Yes?

This is still quite do-able. Decide what your criteria is and do it.

But as for: "the header row is shaded (or formatted differently otherwise) and repeating header rows in the table are not shaded." Nope. Repeated rows are repeated rows. They will be exactly the same as the rows defined to BE repeated. That is the whole point of repeating header rows.

Gerry
 
That was what I presumed. I just wanted to make sure there was no way. Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top