Mail merge and long tables

J

JKarchner

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?
 
D

Doug Robbins - Word MVP

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
 
J

JKarchner

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?
 
D

Doug Robbins - Word MVP

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
 
J

JKarchner

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?
 
D

Doug Robbins - Word MVP

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
 
J

JKarchner

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.
 
J

JKarchner

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.
 
J

JKarchner

And i figured out about the rows breaking, I was not thinking about the
option correctly. Apparently i needed to uncheck the option to allow
breaking of the row across the pages. I thought it meant break from the
table, not break in the middle of the row.
 
J

JKarchner

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.
 
D

Doug Robbins - Word MVP

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
 
J

JKarchner

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
 
D

Doug Robbins - Word MVP

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
 

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