Re: Mail merge and long tables

Tech-Archive recommends: Speed Up your PC by fixing your registry



The code that you have posted has carriage returns in the wrong place. The
individual lines of code are

Line 1 Dim i As Long

Line 2 With ActiveDocument

Line 3 For i = 1 To .Sections.Count

Line 4
..Sections(i).Headers(1).PageNumbers.RestartNumberingAtSection =
False

Line 5 Next i

Line 6 End With

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"JKarchner" <JKarchner@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:959238D6-93A8-4A67-8371-1552D59A1945@xxxxxxxxxxxxxxxx
I tried running the macro that you supplied, however i am getting an error.
It says the .Count is an invalid qualifier. Here is what the code looks
like
when i put it in.

Sub PageNumbers()
'
' PageNumbers Macro
' Macro created 9/11/2006 by jkarchner
'
Dim i As Long
With ActiveDocument
For i = 1 To
.Sections.Count.Sections(i).Headers(1).PageNumbers.RestartNumberingAtSection
= False
Next i
End With

End Sub

"Doug Robbins - Word MVP" wrote:

Use a formletter type mailmerge and execute it to a new document and when
that document is on the screen, run a macro containing the following
code:

Dim i As Long
With ActiveDocument
For i = 1 To .Sections.Count
.Sections(i).Headers(1).PageNumbers.RestartNumberingAtSection =
False
Next i
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"JKarchner" <JKarchner@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7EDD5295-FFED-40F7-A52D-B6FD7587ACF1@xxxxxxxxxxxxxxxx
Ok after further review it does not work like i wanted it. The header
is
repeated on the next page, but there is a problem. The header row that
is
repeated is from the first table. So on every page the header row from
the
first page is repeated at the top. What i would like to happen is that
from
each record the header row is repeated on the next page if and only if
the
next page is part of the same record. Now i got this to work when i
use a
letter merge, but then i lose my page numbering. I have tried to add
the
page number after the merge takes place, but they do not carry over to
the
following pages, and are applied to only the single page. When i do
this,
the page numbers still only appear as one, unless it is the second page
of
the letter (record) and then a 2 appears.

"JKarchner" wrote:

Ok i figured out what went wrong with the table headers not repeating,
it
seems that the option was checked for all of the rows. i changed it
to
just
the first row, and that works perfectly fine.

"JKarchner" wrote:

Thank you so much for the help that you gave me. I'm sorry that i
didnt
mention that the table is contained within a text. I did not create
the
document template and therefore did not know how everything was done
in
it.
You suggestion of removing the text box around the table worked just
like you
said it would. However i have run into some new problems now. When
the data
runs onto the next page, i would like the first row of the table to
be
repeated as the header on the second page. But when i select that
option, it
does not appear on the next page. Is there some way to fix it? My
next
problem is that because i am using a directory mail merge, the
tables
for
each record appear on right after one another, and not on separate
pages like
i want them to. When i use the letter mail merge i get what i want,
but the
pages are not numbered like they are in the directory merge. Is
there
a way
around this, i would still prefer to use the directory merge.

"Doug Robbins - Word MVP" wrote:

Send me a copy of the mailmerge main document and a bit of a file
that
displays the problem and I will take a look at it.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of
my
services on a paid consulting basis.

Doug Robbins - Word MVP

"JKarchner" <JKarchner@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:93D06C26-A6DE-422A-A9FB-C22317BC6B1A@xxxxxxxxxxxxxxxx
I am using the directory type and have it set up so that each
record
should
be at least one page. The table size is that big. I can send
you
a copy
of
the mail merge document if you want, would you like the actual
merged
document or just the sample of what the merge is going to look
like?

"Doug Robbins - Word MVP" wrote:

I am sorry, but it is still not really clear to me how your
mail
merge
main
document is set up. If it is a directory type mail merge main
document,
there would not normally be a new page for each record (unless
the
data
for
a record completely fills the page). If the field for the
record
that is
"found" on the next page was in a cell in the table, then I do
not
see
how
the record would be appearing outside of that cell.

Maybe you should send me a copy of the mail merge main document
so
that I
can understand how you have it set up.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself
of
my
services on a paid consulting basis.

Doug Robbins - Word MVP

"JKarchner" <JKarchner@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message
news:016A1199-4B57-4534-BE23-85BE14F2E25F@xxxxxxxxxxxxxxxx
I created a table that has 10 rows in it. I sued a mail merge
to
bring
in
data from Access by using the directory option. I placed the
results
from
the query in the corresponding rows. The trable is recreated
on
every
page
for each record that is returned from the query. Now the
problem
arises
when
the rows begin to get larger because of results with longer
fields.
When
the
table should continue on the next page it doesnt, and instead
the
record
is
found there. How would i go about setting it up so that my
table is
continued on the next page?


"Doug Robbins - Word MVP" wrote:

Can you explain in a bit more detail how you have the
mergefields
arranged
in the Directory type mailmerge main document and what it is
that
causes
the
"table" for each new record to start on a new page.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail
yourself
of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"JKarchner" <JKarchner@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message
news:AA1758F0-A928-4F64-93B9-E69DDA94AF38@xxxxxxxxxxxxxxxx
I am using a mail merge to put data into a table from
Access.
Each
table
is
a new record, i used the directory option, and each table
lies on a
new
page.
My problem lies when the data in the record causes the
table
to be
longer
than 1 page. The table is not continued on the next page,
and all
of
the
data not on the page is "lost". Is there any way to fix
it?














.



Relevant Pages

  • Re: Saving form file named by a field
    ... Please reply to the newsgroup unless you wish to avail yourself of my ... services on a paid consulting basis. ... Doug Robbins - Word MVP ...
    (microsoft.public.word.vba.general)
  • Re: Saving form file named by a field
    ... Please reply to the newsgroup unless you wish to avail yourself of my ... services on a paid consulting basis. ... Doug Robbins - Word MVP ...
    (microsoft.public.word.vba.general)
  • Re: Mail Merge - If statement
    ... Please reply to the newsgroup unless you wish to avail yourself of my ... services on a paid consulting basis. ... Doug Robbins - Word MVP ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Line separator in Mail Merge
    ... Please reply to the newsgroup unless you wish to avail yourself of my ... services on a paid consulting basis. ... Doug Robbins - Word MVP ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Mail merge response from Doug Robbins- directory displayed in
    ... Please reply to the newsgroup unless you wish to avail yourself of my ... services on a paid consulting basis. ... Doug Robbins - Word MVP ...
    (microsoft.public.word.vba.general)