Repeat Header problem

S

S Shulman

Hi

I encounter the following problem:

After inserting a table to the document I add the following lines:
obTable.Rows.HeadingFormat = True
obTable.Rows.AllowBreakAcrossPages = False
and the table heading is not repeated, however when I record this design to
a macro the come seems identical but that table does repeat the heading

Thank you,
Shmuel Shulman
 
J

Jay Freedman

S said:
Hi

I encounter the following problem:

After inserting a table to the document I add the following lines:
obTable.Rows.HeadingFormat = True
obTable.Rows.AllowBreakAcrossPages = False
and the table heading is not repeated, however when I record this
design to a macro the come seems identical but that table does repeat
the heading

Thank you,
Shmuel Shulman

Hi Shmuel,

Apply the HeadingFormat setting to one specific row at a time, not to the
entire Rows collection.

obTable.Rows(1).HeadingFormat = True

and if you want two rows to repeat, also include

obTable.Rows(2).HeadingFormat = True

The recorded code is a bad example. What I get is

Selection.Rows.HeadingFormat = wdToggle

which applies the HeadingFormat to whatever rows happen to be selected at
the time. Since you've removed the Selection reference and replaced it with
obTable, the reference is to all the rows in the table.
 
S

S Shulman

I was prparing the code to send you and it is working looking into it...

Thank you,
Shmuel
 
Top