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
 

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