Results 1 to 8 of 8
  1. #1
    New Lounger
    Join Date
    Jul 2013
    Posts
    9
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Can you have 2 directories in 1 document?

    I have a mail merge directory with an employee as the main data and a list of their contacts as the listed (directory) data. Everything works fine except that the dept. head would like to see 2 separate lists of data per employee.

    Basically, all of the employee information (name, address, etc.) is at the top of the letter. A list of their contacts follows soon after. There's then some paragraphs in the middle of the document, and I need to then display the contacts' address information in a directory style at the end of the letter.

    The letter might look like this:

    Employee Name
    Employee Address

    Contact 1
    Contact 2
    Contact 3
    Contact 4

    Two paragraphs of the letter.

    Contact 1 Address
    Contact 2 Address
    Contact 3 Address
    Contact 4 Address

    From what I've seen, Word can't do this. It just wants to stack the directory data all in one place and not have some other paragraphs separating the directory data. Am I wrong? If the contact data was all together, there wouldn't be a problem. It needs to be separated, though.

    Any help would be great. Thanks!

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    Yes it can be done but it is tricky to set up. Macropod has produced a series of excellent tutorials on this and other topics. The one you need to look at is http://windowssecrets.com/forums/sho...merge-Tutorial
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    New Lounger
    Join Date
    Jul 2013
    Posts
    9
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Andrew,

    I appreciate the reply. I had gone through Macropod's tutorial before and found it to be an excellent approach to setting up a directory. I couldn't have gotten as far as I have without it. Having said that, it never mentions having two directories in one document. He talks about grouping by two key fields (City and State were his examples), but that's not what I need. It sounds simple but I'm finding it to be impossible in Word. I want to group by one key field (Employees) and list their related data in two separate places in the letter. From what I can see, Word can only have a list of data in one place.

    Word can do this:

    Employee Ralph (Key field being the Employee ID)

    Contacts:

    John Smith
    123 Anywhere
    Boston, MA 00021

    Jane Doe
    456 Somewhere
    Portland, OR 97206

    What Word cannot do is this:

    Employee Ralph

    Contacts:

    John Smith
    Jane Doe

    Three blocks of paragraph text.

    Contact Addresses:

    John Smith
    123 Anywhere
    Boston, MA 00021

    Jane Doe
    456 Somewhere
    Portland, OR 97206

    Any ideas would be appreciated.

  4. #4
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    OK, I see what you are trying to do now. Once you click across to the Jane Doe entry you have lost access to the John Smith record and so can't call up the address fields

    I would attempt to solve this in a few possible ways. Method 1 and 2 will definitely work but may be difficult unless you have experience in this. The others have potential but would need some fiddling to be sure to work.

    Method #1 - use vba to build all the letters without using a mailmerge at all

    Method #2 - use Microsoft Access to produce the report outputs.

    Method #3 - Put the source data into an XML format and use content controls and/or vba to populate the letters.

    Method #4 - Add all the information I wanted in the document using mergefields and then hide the info I needed to appear later. Then use a cross-reference or styleref field to get it to appear the second time where it was actually needed.

    Method #5 - Rewrite the sql query that word is using in the merge to package the fields into a simple. You might find it easier to use Access to create the query and then link your merge to that query.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  5. The Following User Says Thank You to Andrew Lockton For This Useful Post:

    Beeblebrox (2013-07-25)

  6. #5
    New Lounger
    Join Date
    Jul 2013
    Posts
    9
    Thanks
    3
    Thanked 0 Times in 0 Posts
    I appreciate your help on this. I realized that we are 12 hours different, so I'm writing this before I go to bed. I don't have the skills in vba to attempt Method #1, and Crystal is my only reporting option, which rules out Method #2. I'm not sure where to begin for Methods #3 and 5, as my XML and SQL knowledge is limited.

    I'm very curious about Method #4. How would I go about hiding my addresses so that they could appear later in the letter? Could you point me in the right direction for using either a cross-reference or styleref to do this?

    Thanks again!

  7. #6
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    I tested that idea out and it didn't work. I hid the text but the styleref field shows the displayed text only (ie nothing). I could make the content visible and position it off the page but that wouldn't solve the issue anyway. We wouldn't be able to get a different bookmark or style onto each output address purely with the merge engine so the crossref/styleref would all point at the last one anyway.

    Another option springs to mind. What if you did the following? This might work by building the names above the other content using a TOC field so the directory info only has to be imported once.

    Employee Ralph

    Contacts:
    A TOC field with the following contents {TOC \t "ContactName,1" \n}

    Three blocks of paragraph text.

    Contact Addresses:

    John Smith [mergefield using a style called ContactName]
    123 Anywhere
    Boston, MA 00021

    Jane Doe [mergefield using a style called ContactName]
    456 Somewhere
    Portland, OR 97206
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  8. The Following User Says Thank You to Andrew Lockton For This Useful Post:

    Beeblebrox (2013-07-26)

  9. #7
    New Lounger
    Join Date
    Jul 2013
    Posts
    9
    Thanks
    3
    Thanked 0 Times in 0 Posts
    I'm not sure if you're still awake, but I couldn't get the TOC to work. I put it in exactly as you had it laid out, {TOC \t "{ContactName,1}" \n}, but when I ran the merge I got "No table of contents entries found." I even tried it with sample text, {TOC \t "SAMPLE TEXT" \n}, and also got "No table of contents entries found."

    Is there another way to approach the TOC?

  10. #8
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    Did you create a style called ContactName and apply it to the text where the (second) John Smith and Jane Doe appeared?
    Last edited by Andrew Lockton; 2013-07-26 at 18:56.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

Posting Permissions

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