delete blank fields or rows in a table in word 2003

已答复 delete blank fields or rows in a table in word 2003

  • Tuesday, July 31, 2012 6:11 PM
     
     

    I need help figuring out how to delete blank fields/rows in a table.

    I am making a report card type document using mail merge and an excel spreadsheet. None of the fields in the excel sheet are blank, the blanks are in the word document. childhood immunizations" as measures for which someone is eligible. so, if you are diabetic, you have a 1 in that column, if not u have a 0. Then, next to it is the test that you are supposed to get. So, diabetic would have an eye exam, HbA1c test, and LDL screening. If you have had these tests, you have a 1, if not u have a 0. This data is mail merged with a template I wrote for word 2003. 

    So, i have an if...then..else in the leftmost column of my word table for the measure. So, if you are diabetic, you have a 1 and the template then self populates the words "diabetes management" into the field. If you are not, you have a 0 and the field is told to put no text in. The middle column has a check mark, which is if then else for a 1 or 0 in the test column n excel. The last column is if then else for eligibility just like the first, but has an explanation in it. The problem is is that not everyone has every condition. Someone may just be eligible for one...if so, how do I get rid of the field/row that corresponds with the condition they do not have? 

    SO, what i need to do is figure out how to get it to automatically or at the push of a button, delete/suppress/hide all the fields with nothing in them. Ideas? So, it is not that the excel fields they correspond to are blank (as all the solutions on the web deal with), but that they are 0....and the word tables are blank. Ideas? Thank you 

     Really long a wordy, sorry.

All Replies

  • Tuesday, July 31, 2012 10:45 PM
     
     Answered
    A mailmerge cannot delete/hide an individual table row. What you would need is a separate table for each row/item and embed that whole table within your IF test.

    Cheers
    Paul Edstein
    [MS MVP - Word]

  • Wednesday, August 01, 2012 7:51 AM
    Moderator
     
     

    Hi,

    Based on my research, we can conditionally insert the content of that field.

    For example:

    {IF{Mergefield fieldname} <> "" "{Mergefield fieldname}"}

    Jaynet Zhang

    TechNet Community Support

  • Wednesday, August 01, 2012 8:02 AM
     
     Answered

    Jaynet,

    It would be helpful if you addressed the question. And, in any event, your field construction is unnecesary for what it's designed to do - suppress empty output.

    What the OP needs is a field coded along the lines of:

    {IF{Mergefield fieldname}<> "" "[diabetes management table]"}

    The diabetes management table may, of course, contain various mergefields. 


    Cheers
    Paul Edstein
    [MS MVP - Word]