Results 1 to 8 of 8
  1. #1
    Star Lounger
    Join Date
    Sep 2003
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    TOC can't be update after merge (2003)

    Good morning, we have a problem with or merged documents. We have a document with a TOC that's updateable, after we have run the merge with a ERP program the fields are filled but the TOC isn

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: TOC can't be update after merge (2003)

    I'm not sure I understand what you mean. Are you running a mail merge? A TOC won't survive a mail merge.

  3. #3
    Star Lounger
    Join Date
    Sep 2003
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TOC can't be update after merge (2003)

    We use a ERP application to build tenders, when we click a word icon in the application word take over the name, adres etc. from the database. The document he put this information in has a TOC that's updatable. (if you open that document without using the ERPprogram) But after he merged the information from the database in the document it isn't updatable anymore.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: TOC can't be update after merge (2003)

    If this is a mail merge in the sense of Tools | Letters and Mailings | Mail Merge... (Afdruk samenvoegen in Dutch), this is to be expected. Word replaces the TOC field with its individual components during the merge, and these are not updateable any more. You'd have to insert the TOC after merging to get an updateable TOC.

  5. #5
    Star Lounger
    Join Date
    Sep 2003
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TOC can't be update after merge (2003)

    I have made a before and after document so you can look what happens. I thought that there maybe was a mistake in the macro in the before document. Or that it
    Attached Files Attached Files

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: TOC can't be update after merge (2003)

    The macro in the Before document is password-protected, so I cannot examine it, but the After document looks exactly as expected after a mail merge. You could cut the TOC to the clipboard (ans if necessary paste it into another document) before the merge, then paste it back after the merge.

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: TOC can't be update after merge (2003)

    You could try the following:

    1) Above the line

    With ActiveDocument.MailMerge

    insert this line:

    ActiveDocument.TablesOfContents(1).Range.Cut

    This will remove the TOC and place it on the clipboard.

    2) Below the corresponding

    End With

    (the one after the .Execute line) insert these lines

    Selection.Find.Execute "Inhoudsopgave"
    Selection.MoveDown Unit:=wdLine, Count:=2
    Selection.Paste
    ActiveDocument.TablesOfContents(1).Update

    This moves to the text "Inhoudsopgave", then moves two lines down, pastes the TOC back, and finally updates it.

  8. #8
    Star Lounger
    Join Date
    Sep 2003
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TOC can't be update after merge (2003)

    Hello Hans,
    it works great!

    Thanks,
    Gerwin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •