View Single Post
  #4   Report Post  
Mr Penguin Mr Penguin is offline
Junior Member
 
Posts: 1
Default

Hi Doug Robbins,

Sry, I know this is an old post but I have to try.

Could you provide me the macro to create the TOC after merging to a new
document? I've been looking for this for about a week. I just can't find it through Google...

I will be very grateful if you can send me this macro.

Greetings,
Mr Penguin

Quote:
Originally Posted by odudley View Post
Thanks Doug. I found a workaround tho. I formatted the "Title" field as
Heading 1. Then created a macro to insert the TOC after merging to a new
document. This works perfectly.

"Doug Robbins - Word MVP" wrote:

What you trying to do sounds like a "multiple items per condition (=key
field)" mailmerge (with an added complication) which Word does not really
have the ability to do:

You may find something in the "Group Multiple items for a single condition"
item on fellow MVP Cindy Meister's website at

http://homepage.swissonline.ch/cindy...faq1.htm#DBPic


Or take a look at the following Knowledge Base Article

http://support.microsoft.com/default...b;en-us;211303

or at:

http://cornell.veplan.net/article.aspx?&a=3815

However, I am inclined to think that your only option is going to be to
perform the directory merge use a main document that has nothing other than
the merge fields in it, and then manually copy in the document title and
create the table of contents. If you apply a Heading 1 style to the
title mergefield in the mail merge main document, it will be retained
when you execute the merge to the new document so that it is possible to
insert the table of contents in the normal way in that new document. That
is going to be a lot simpler than cleaning up what you now have.

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

"odudley" wrote in message
news
My current dilema is that I cannot figure out how to enter a TOC into my
mailmerge. I have an introductory page that has a Title and TOC, then a
pagebreak, then the directory. The table of contents is based on a field
in
the directory. The directory function is causing my title, TOC and
pagebreak
to repeat before each record. There are many records so cutting and
pasting
is not an option.

What I Want:

"Document Title as Written"

[TOC] -- listing each individual title and page

pagebreak

title -- field formatted as Heading1 so each title will show in TOC
text -- often more than one page
pagebreak
nextrecord
title
text
pagebreak
nextrecord

What I Have:
"Document Title as Written"

[TOC] -- views as "title"..............2

pagebreak

title -- shows title of first record
text -- shows text of first record
pagebreak
nextrecord
"Document Title as Written"

[TOC] -- views as "title"..............4

pagebreak

title -- shows title of next record
text -- shows text of next record
pagebreak
nextrecord

PLEASE PLEASE HELP!!!!