WD97: How to Merge Conditional Number of Records to the Same PageID: Q105888
|
In Microsoft Word, you can merge a conditional number of records to the same page.
To merge a conditional number of records to the same page, use a
combination of SET, IF, and NEXTIF fields. For example, you could use
this method to merge all records with the same name to one page in the
merge and create a new page in the merge when a new name is encountered in
the data file.
Microsoft provides programming examples for illustration only, without warranty
either expressed or implied, including, but not limited to, the implied warranties of
merchantability and/or fitness for a particular purpose. This article assumes that you
are familiar with the programming language being demonstrated and the tools used to
create and debug procedures. Microsoft support professionals can help explain the functionality
of a particular procedure, but they will not modify these examples to provide added
functionality or construct procedures to meet your specific needs. If you have limited
programming experience, you may want to contact a Microsoft Certified Solution Provider
or the Microsoft fee-based consulting line at (800) 936-5200. For more information about
Microsoft Certified Solution Providers, please see the following page on the World Wide Web:
http://www.microsoft.com/mcsp/For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
http://www.microsoft.com/support/supportnet/overview/overview.asp
Employee Project Check
John Doe 4578j
John Doe 86785x
John Doe 543p 1
Jane Doe 87x
Jane Doe 89976m 1
Sam Smith 7897r
Sam Smith 857t
Sam Smith 78974x
Sam Smith 7868p 1
The main document should be set up as follows, with a copy of the
conditional statements equal to the maximum number of projects for
each employee (four in the above example).
Employee Project
{MERGEFIELD Employee} {MERGEFIELD Project}{set duplicate {if
{MERGEFIELD Check}="1" "off" "on"}}{nextif {mergefield check}=""}{if
{duplicate}="on" "P
t{MERGEFIELD Project}"}{set duplicate {if {MERGEFIELD Check}="1"
"off" "on"}}{nextif {mergefield check}=""}{if {duplicate}="on" "P
t{MERGEFIELD Project}"}{set duplicate {if {MERGEFIELD Check}="1"
"off" "on"}}{nextif {mergefield check}=""}{if {duplicate}="on" "P
t{MERGEFIELD Project}"}{set duplicate {if {MERGEFIELD Check}="1"
"off" "on"}}{nextif {mergefield check}=""}{if {duplicate}="on" "P
t{MERGEFIELD Project}"}
Employee Project
John Doe 4578j
86785x
5436435p
--- Page Break ---
Jane Doe 87x
89976m
--- Page Break ---
Sam Smith 7897r
857t
78974x
7868p
Additional query words: catalog index list table print merge mail group variable different
Keywords : kbualink97 kbfield word97 kbmerge
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbinfo
Last Reviewed: July 30, 1999