+ Reply to Thread
Results 1 to 9 of 9

Mail Merge (SKIPIF Static text??)

  1. #1
    Registered User
    Join Date
    06-06-2018
    Location
    San Antonio, TX
    MS-Off Ver
    2013
    Posts
    9

    Mail Merge (SKIPIF Static text??)

    Hi - Does anybody know if there is a way of skipping static text? Specific a table?

    I have a Word Template that has a series of tables that populate from my source data- but if there is not data in the source (or if I SKIPIF) all the data, I would like to NOT display the headers of the table.

    I tried putting my SKIPIF statement before the table headers, but no luck.

    Any clues?

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Mail Merge (SKIPIF Static text??)

    SKIPIF affects the output of an entire record, not to a field within a record. Use an IF test to assess the data's presence, only outputting the table if there are data for it.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Registered User
    Join Date
    06-06-2018
    Location
    San Antonio, TX
    MS-Off Ver
    2013
    Posts
    9

    Re: Mail Merge (SKIPIF Static text??)

    Thanks Paul. I'm not sure I quite understand how to use IF to only output the table if there is data for it... attached is a sample of a couple tables i'm working on. Regardless of whether data is there or not, the headers display. How would I leverage IF to not show those headers?
    Attached Files Attached Files

  4. #4
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Mail Merge (SKIPIF Static text??)

    See attached. Your field coding also suggests you're using a third-party mailmerge app. Accordingly, you may be limited to what that app allows.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-06-2018
    Location
    San Antonio, TX
    MS-Off Ver
    2013
    Posts
    9

    Re: Mail Merge (SKIPIF Static text??)

    Hi Paul - Thank you for demonstrating how to include the tables into the IF statements. Could I bother you to look at one final attachment if you can? I tested 2 different means of putting tables into IF statements... Both ways work for me - however i'm noticing that if the first table has no data from the source, it will not display the table (as expected), however once one IF statement tests true, all tables below it will test true as well and display the headers without data.

    So in my example attached I have 3 IF statements
    If Statement 1 tests true, then 2 and 3 will both display with no data
    If Statement 1 tests false, but statement 2 tests true, then Statement 3 will display with no data
    If statement 3 is the only one that tests true, then 1 and 2 will not display (as expected) and Statement 3 will display (as expected).

    Can you tell me if I'm doing something wrong or, if this is a side-effect of my using a 3rd party product that integrates with MailMerge?
    Attached Files Attached Files

  6. #6
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Mail Merge (SKIPIF Static text??)

    There doesn't seem to be a lot in common between what I supplied and your attachment.

    Some immediately apparent problems:
    1. You have your {MERGEFIELD TableStart:Business_Processes} outside the IF field, but the corresponding {MERGEFIELD TableEnd:Business_Processes} inside it. This anomoly is repeated for the Requirements as well.
    2. Your last table's IF test is constructed as {IF{MERGEFIELD TableStart:Recovery_Strategies}{ MERGEFIELD Strategy_ID}<>"" {MERGEFIELD TableEnd:Recovery_Strategies} "(table)"}, which is quite illogical as, has the operator been expressed correctly (see below), it would tell Word to output the table exactly when you don't want it to.
    3. Your IF tests are all missing the required space after the <> operator.
    It's little wonder, then, you're not getting the desired results.

    Try the attached. Note that I've deleted the many \* MERGEFORMAT switches; they're quite unnecessary.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    06-06-2018
    Location
    San Antonio, TX
    MS-Off Ver
    2013
    Posts
    9

    Re: Mail Merge (SKIPIF Static text??)

    Ha... yeah, you're right I did change it around quite a bit from what you initially provided me. I realized the first time I uploaded an attachment, I was missing all the TableStart/TableEnd's. I did not know I could place the table - with all the other code within an IF statement - so I attempted to follow the logic you provided but placed the TableStarts/Ends where I thought they needed to be (hence the varying attempts at a TableStart outside the IF and a TableStart within the IF.

    However, after all the code is complete, I'm still getting the same end result. I can get each IF statement to work (display with data, not display IF not data) independently. Additionally, if all 3 test true, all 3 display properly. If all 3 test false, all do not display (properly). Depending on which one is on top of the code, the other 2 do not work. (and will display headers even without data so long as the IF above it tests true).

  8. #8
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Mail Merge (SKIPIF Static text??)

    Quote Originally Posted by jasendill View Post
    I can get each IF statement to work (display with data, not display IF not data) independently. Additionally, if all 3 test true, all 3 display properly. If all 3 test false, all do not display (properly). Depending on which one is on top of the code, the other 2 do not work. (and will display headers even without data so long as the IF above it tests true).
    And you got that result with the unmodified attachment to post 6 (other than adding the data source)? If so, I suggest you refer the matter to whoever makes your addin (Aspose? Conga? RSA Archer?) for resolution as the product has a bug.

  9. #9
    Registered User
    Join Date
    06-06-2018
    Location
    San Antonio, TX
    MS-Off Ver
    2013
    Posts
    9

    Re: Mail Merge (SKIPIF Static text??)

    I suspect you may be right (about the bug). I'm going to open a Case with RSA Archer.

    Always much appreciated.
    Last edited by jasendill; 09-04-2018 at 03:05 PM. Reason: realize he answered this question above.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. mail merge/table text direction
    By Okii in forum Word Formatting & General
    Replies: 1
    Last Post: 08-19-2016, 08:17 PM
  2. Replies: 0
    Last Post: 01-05-2015, 07:35 AM
  3. VBA code to perform mail merge using text file
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-08-2013, 04:46 AM
  4. mail merge (word 2010) cuts off the text after 255 characters
    By Giolina in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-12-2013, 01:33 PM
  5. Replies: 2
    Last Post: 07-12-2012, 08:11 PM
  6. Add text from sheet to pictures (Mail merge style)
    By North in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-29-2009, 11:44 AM
  7. [SOLVED] Truncation of text when using mail merge.
    By Macy in forum Excel General
    Replies: 5
    Last Post: 09-14-2005, 06:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1