I have created a mail merge document by basing it on this link....
http://support.microsoft.com/default.aspx?scid=kb;en-us;211303
All well and good, apart from my item details. When I click the Merge
button, everything works fine, until I get to the last line on each page and
it is duplicated.
The code I have used is as follows:
Header: {nextif{set duplicate {Mergefield Check} = "1"} {Mergefield
Personnel_Area}
Item: {Mergefield Initial} {Mergefield Last_Name}
Item: {NextIf{Mergefield Check } = ""} {Mergefield Initial} {Mergefield
Last_Name}
Item: {NextIf{Mergefield Check } = ""} {Mergefield Initial} {Mergefield
Last_Name}
Item: {NextIf{Mergefield Check } = ""} {Mergefield Initial} {Mergefield
Last_Name}
Item: {NextIf{Mergefield Check } = ""} {Mergefield Initial} {Mergefield
Last_Name}
Item: {NextIf{Mergefield Check } = ""} {Mergefield Initial} {Mergefield
Last_Name}
Item: {NextIf{Mergefield Check } = ""} {Mergefield Initial} {Mergefield
Last_Name}
Item: {NextIf{Mergefield Check } = ""} {Mergefield Initial} {Mergefield
Last_Name}
Item: {NextIf{Mergefield Check } = ""} {Mergefield Initial} {Mergefield
Last_Name}
I have a colum headed Check, and it is flagged with a 1 if it is the last
record for the Area.
It all works apart from duplicating the last entry to the bottom of the
page.... I have tried <>1 or = "" but get the same result either way.
Any thoughts??
Many thanks.
Word isn't very good at this - if possible produce your report in Access or
similar.
It looks as if your approach is more similar to the one described in
http://support.microsoft.com/default.aspx?scid=kb;en-us;212375
- if so, you need to follow their pattern very closely. You have to be
really careful with NEXTIF and SKIPIF because it is easy to get the wrong
idea about what they actually do. For example, when you use NEXTIF and the
condition fails, all that happens is that Word does not read the next
record. In that case, if you have MERGEFIELD fields after the NEXTIF, they
will display exactly the same info. as the MERGEFIELD fields just before the
NEXTIF.
Peter Jamieson
>I have created a mail merge document by basing it on this link....
> http://support.microsoft.com/default.aspx?scid=kb;en-us;211303
[quoted text clipped - 36 lines]
>
> Many thanks.
Paul Baynton - 26 Oct 2004 23:01 GMT
Bazza,
If you can make the example in
http://support.microsoft.com/default.aspx?scid=kb;en-us;211303
work, its definitely the better method to use.
Using a key field comparison to determine where the different areas end
instead of a flag in the data makes everything a lot easier to follow and
understand.
If you need any more help, please post again to this thread.
Thanks
Paul
> Word isn't very good at this - if possible produce your report in Access or
> similar.
[quoted text clipped - 53 lines]
> >
> > Many thanks.