How to find the top row of a table

W

WayneM

I am using vb6 to control Word. I have a table that spans
multiple print pages. How can I find the top row on each
new page so I can add a header row?

Any help is appreciated.

Thanks in advance,

WayneM
 
D

Doug Robbins

Hi Wayne,

Assuming that you want to make use of Words ability to repeat some rows of a
table as heading rows on subsequent pages on which the table continues, you
set the HeadingFormat property of the rows that you want to repeat to True.
You do not need to locate the first row on each page in this case.

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
D

DA

Hi Wayne

If you would write the code in Word, the following shows
you how to cycle through each table and check if the
first row is formatted as a heading.

'--------------------
Sub TblHead()
Dim lngCounter As long
With ActiveDocument
For lngCounter = 1 To .Tables.Count
If .Tables(lngCounter).Rows(1).HeadingFormat = True
Then
MsgBox "First row is already a heading"
Else
.Tables(lngCounter).Rows(1).HeadingFormat = True
End If
Next
End With
End Sub
'--------------------

Hope that helps in some way,

Dennis
 

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