View Single Post
  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor
 
Posts: n/a
Default Mail Merge Filters

You could probably use the method shown in the section "Testing for a value
in one of several fields." at
http://www.gmayor.com/formatting_word_fields.htm to test for values in the
same mergefield.
eg where the field in question is 'Field1' and the three values sought are 1
3 and 7 then the following inserted at the start of the merge document will
only merge records that do not have those numbers in that field:

{ SET CHECK { IF{ =({ IF{ MERGEFIELD Field1 } = "1" 1 0 } + { IF{ MERGEFIELD
Field1 } = "3" 1 0 } + { IF{ MERGEFIELD Field1} = "7" 1 0 }) } = 1 "TRUE"
"FALSE" } }{ SKIPIF { CHECK } = "TRUE" }


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Jan L wrote:
Perhaps I didn't explain very well. The Excel spreadsheet keeps our
data. One of the data columns has a code, there are about 10
different codes that are used in that column to represent the
condition of the individual in that record. In merging the
information from the spreadsheet into the Word document, this column
tells us how to treat each individual, in other words, if they should
be receiving the letter that is being sent. In the current
situation, there are 7 codes in this particular column that represent
the individuals who will receive the letter and three codes will not
be part of the merge. So I was trying to select these specific
individuals by using the Filter capabilities in the advance merge
selection. I hope this clarifies our situation.
Jan L


"Doug Robbins - Word MVP" wrote:

Word is not really the best thing to use for data manipulation. I
would add a column to your Excel spreadsheet that you populate with
a 1 or a O by using the formula/functions that are available in
Excel and then use that one column as a basis for filtering the
records.

When you want to use some different criteria, modify the formula that
populates that column so that the required records are assigned the
appropriate value.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Jan L" wrote in message
...
I am trying to use the advanced filters. We have an Excel
spreadsheet that we have our list and are merging it with a form in
Word. The Excel file contains a number of criteria that we want to
use to filter the merge recipiants however it's not working. For
example, one column of the Excel spreadsheet contains a number
code. I would like to select all but three codes. So I selected,
the field, "not equal to" and the entered the first number code. I
connected it with an "and" (I also tried "or") to the next item,
which was the same field, "not equal to" and the second number code
and
followed that with the third line item with the next number code.
There should have been a lot more records selected than actually
showed up. What
am I missing?

Second. I have been able to use two criteria and get that to work,
but when
I want to go back and change the filter criteria, it's not
viewable. Do I always have to re-attach the Excel spreadsheet each
time I want to change the
filter criteria?

Thank you for your help with this.
Jan
--
Jan L