Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SKIPIF in Mail Merge or similar functionality (Word 2K, Win 2KPro)

    I'd like to use something like SKIPIF in a rather complex form letter merge document and noticed that the Help says not to use SKIPIF but to use the Query filter options in Mail Merge helper. Unfortunately, that will not work.

    The situation is this: I am merging from a db and there is a criteria (MemberType) assigned to name, address, phone etc. information. On the merge document, I want to be able to do something like this:

    Coordinators
    Name: SKIPIF {MemberType<>Coordinator, {MERGEFIELD FullName}} -- that is to say, lookup the MEMBERTYPE and only printout the Mergefiled contact info if it is a particular criteria. The problem here is that, on the SAME DOCUMENT, I want to repeat the process but with a different criteria for the MemberType, like:

    Chairs
    Name: SKIPIF {MemberType<>Chair, {MERGEFIELD FullName}}

    And several more sections on the SAME DOCUMENT merging from the datasource.

    The Query options in the Merge Mail helper apply to all records for the entire merge document, so I can only produce a stack of contacts for each one in seperate mail merge operations, which is really undesireable as I want to be able to merge into and display whatever member types happen to exist for a given Region on a single page.

    In essence, what I want to do is run more than one query on the same mail merge document and the Mail Merge Helper is built to run a single query over all records for all mergefields in a given document so that's not gonna work.

    Any suggestions?

    TIA!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: SKIPIF in Mail Merge or similar functionality (Word 2K, Win 2KPro)

    Can't you use an IF field for this? See the examples in the online help for IF.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SKIPIF in Mail Merge or similar functionality (Word 2K, Win 2KPro)

    that's what i'm trying to do. the online help on IF doesn't obviously refer to outputting a different Mailmerge field if the IF evaluates true -- it discusses outputting a text response. i seem to be making some progress by referring the WordMVP site (which has some code that seems to do what I want) so I'll just keep slogging away.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: SKIPIF in Mail Merge or similar functionality (Word 2K, Win 2KPro)

    You can use nested fields, for example

    { IF { MERGEFIELD Membertype } = "Coordinator" "{ MERGEFIELD FullAddress }" "" }

    The best way to create nested fields either by creating them apart, then cutting one and pasting it inside the other, or by creating them manually. You must NOT type the brackets { } yourself, use Ctrl+F9 to insert an empty pair of field brackets.

    You can also use AND - the online help for Word 2002 has an example of that - and nested IF fields.

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SKIPIF in Mail Merge or similar functionality (Word 2K, Win 2KPro)

    that's almost exactly what I tried but neglected to put in the quotes for the IF result specifications. It works somewhat but I get a new merge doc for each one. For example, the source data for a CRCG has an Other, a Chair and a Co-Chair, but instead of one page with all listed I get three page with one of each listed. I tried doing a long nested field with AND like so:

    { IF { MERGEFIELD Membertype } = "Coordinator" "{ MERGEFIELD FullAddress }" "" AND IF { MERGEFIELD Membertype } = "Chair" "{ MERGEFIELD FullAddress }" ""}

    Which doesn't seem to do much either way. I am in Word 2000 and the help file is a bit skimpy on the use of this type of code. Well, need to keep plugging away. at least everyone's out of the office so I have all day to hack at it.

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: SKIPIF in Mail Merge or similar functionality (Word 2K, Win 2KPro)

    I haven't used the IF field in Word, but its syntax appears similar to the IF field in FileMaker Pro. If that is the case, you embed your next IF field in the "false" clause of the first field, and so forth. This worked in a quick test:

    { IF A = B "A equals B" "{ IF A = C "A equals C" "A does not equal B or C" }" }

  7. #7
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SKIPIF in Mail Merge or similar functionality (Word 2K, Win 2KPro)

    good suggestion but i'm afraid it won't do much good in my case. The thing is, I am trying to print on a single page for a given set of parameters (Region, Counties Covered, CRCG Name etc.) whether there is a [MemberType] Coordinator or a Chair or a Co-Chair or an Other. When I run an merge I get the parameters repeated for each different MemberType. The intention is to have the page setup with this information to be merged and if there are 3 MemberTypes for a particular set of criteria to have all three printed once on one page with the criteria information as a 'header'. I can get a rough go at this in an Access Report but I need to produce a useful editable file (this is for a survery form) and Access Reports are not gonna cut it.

    I'm currently trying out the Catalog mail merge type to see how it might work.

  8. #8
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: SKIPIF in Mail Merge or similar functionality (Word 2K, Win 2KPro)

    You want a many-to-one merge? Someone should write a FAQ on that, it seems to come up every six months. Unfortunately, not being a merge person, I can never remember the solution. You might try the Word FAQs at http://www.mvps.org/word/ to see if they have one on point.

  9. #9
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SKIPIF in Mail Merge or similar functionality (Word 2K, Win 2KPro)

    I happen to be on that website right now. There's some info that may get me where I need to go but it's not all that explicit so I'll have to bang around a bit. If I can get this thing going I'll put together a Tute on it.

  10. #10
    Star Lounger
    Join Date
    May 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SKIPIF in Mail Merge or similar functionality (Word 2K, Win 2KPro)

    Hi Steve,

    If you are still having troubles try Cindy Meister's site . She has some great merge tips. I seem to remember there being a tip on merge many items to one letter.

    Regards,

    Matthew

  11. #11
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SKIPIF in Mail Merge or similar functionality (Word 2K, Win 2KPro)

    thanks for the link. the information there is actually the same info as on the Word mvp site http://www.mvps.org/word/ and I've tried to adapt my situation to the recommendations, which are not very clear as I don't know how to use SET and haven't had much luck finding sources for it. however, last friday there seemed to be a problem with www.microsoft.com so I wasn't able to find info from the horse's mouth, so to speak. so, I still am not very close to a solution. ah well, must keep trying.

  12. #12
    Star Lounger
    Join Date
    May 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SKIPIF in Mail Merge or similar functionality (Word 2K, Win 2KPro)

    Steve,

    I'm sure someelse will explain this better but I will have a go first.

    The SET field can be used to "define" a bookmark.
    eg. {SET SkyColour "Blue" } stores the word "Blue" in the bookmark. This information can than be compared against other records using the IF field or inserted into the document using the REF field.

    The MVPs article use the SET field to store the first & last name of the current record in a bookmark called "Check". Upon starting the next record in the merge, it compares contents of the "Check" bookmark with the next records first & last name.
    --------------------------
    From MVP site
    { IF REF Check <> "{ MERGEFIELD FIRSTNAME } { MERGEFIELD LASTNAME "
    "{ MERGEFIELD FIRSTNAME } { MERGEFIELD LASTNAME }

  13. #13
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SKIPIF in Mail Merge or similar functionality (Word 2K, Win 2KPro)

    hmmm... at least that clears that up. thanks for the tip on SET and REF.

    Unfortunately, I don't think word Merge fields are flexible enough for my needs. Not only do I need to test if a condition is met, I have to output text as well as merge field values.

    Fortunately, I did find a potential solution: use asp to generate an .rtf document; .asp supports more robust branching and you can get it to write out lines depending on whether a condition is true or not. I am working on this angle now... The only inconvenience (and it's a bit tedious) is having to learn .rtf markup.

    This is not a solution for everyone, but in my case it's alright because I have IIS installed and running on my system.

  14. #14
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: SKIPIF in Mail Merge or similar functionality (Word 2K, Win 2KPro)

    <hr>...I have to output text as well as merge field values<hr>
    FWIW, you can easily add text as well as mergefields - you simply specify the conditional text string in the appropriate place in the IF field.
    Wendell

  15. #15
    Star Lounger
    Join Date
    May 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SKIPIF in Mail Merge or similar functionality (Word 2K, Win 2KPro)

    As Wendell indicated, you can have text appear as part of your IF field.

    eg use the MVP example
    { IF REF Check <> "{ MERGEFIELD FIRSTNAME } { MERGEFIELD LASTNAME} "
    "The client's name is { MERGEFIELD FIRSTNAME } { MERGEFIELD LASTNAME }" "" }

Page 1 of 2 12 LastLast

Posting Permissions

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