Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Mar 2015
    Thanked 0 Times in 0 Posts

    Word Directory Mailmerge - how can I use and increment a numeric variable in merge code?

    Hi, I have a Directory mail merge, ie. I have a spreadsheet of say 1000 records that gets printed on say 20 letters...each letter possessing a table with 50 records. I need to do something to manually split up my table at the 30th record within each letter so that it rolls to the 2nd page of the letter without issue. I initially thought I could use MERGESEQ, but this variable doesn't reset letter from letter so I can't use it directly. Can someone please help me understand how I can use QUOTE or SET or bookmarks or whatever to perhaps first set a variable = 1 at the start of the letter (when it recognizes a new key, different than the last record) and how to increment that variable by +1 for each subsequent record?



  2. #2
    Super Moderator
    Join Date
    May 2002
    Canberra, Australian Capital Territory, Australia
    Thanked 428 Times in 353 Posts
    Without seeing what other field coding you're using, it's impossible to give specific advice. However, you will need to use a SET field to create a bookmark that can be used for a counter (e.g. {SET Counter = 0} or {SET Counter = 1}, depending on where you insert the field). Then, for each record, you'd increment the counter (e.g. {SET Counter = Counter +1}). Finally, to insert the page breaks, you'd use a field coded like {IF{=MOD(Counter,30) \# 0}= 0 {QUOTE 12}} or {=MOD(Counter,30) \# ";;'{QUOTE 12}'"} to generate the page break. If you're grouping the records, you'd also need a field coded like {SET Counter = 0} or {SET Counter = 1} to reset the counter whenever the group changes.

    Paul Edstein
    [MS MVP - Word]

Tags for this Thread

Posting Permissions

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