Link to home
Start Free TrialLog in
Avatar of Pancomp60
Pancomp60

asked on

How can I modify a mail merge list in Word 2016

I have a Word 2016 Merge document that uses a merge field to pull names from a database and make a numbered list.  I would like to do one of two things; either add a short underline immediately after each name in the list or, under line each name with the underline extending to the right margin (see example)sample-Document.pdf
Avatar of Pancomp60
Pancomp60

ASKER

Apologies, here is the example
sample-Document.pdf
Avatar of Rgonzo1971
Hi,

You could try
{ MERGEFIELD List_of_Names}{ IF { MERGEFIELD List_of_Names} = "" ""  " / ______" }

Open in new window

Regards
If you setup the document with a table, you can add a border to the bottom of the table cells. This then looks like it is underlined.
Unfortunately setting the field into a table puts all of the names in a top down list with an "underline" next to the last name in the list only.  I should also specify that the merge variable was created in the SQL program we use to track the information so it is not susceptible to a NEXT RECORD IF statement where you would build a table and put merge fields in each cell for a given number of cells.  This merge variable pulls each record and separates them with a <CR>.
{ MERGEFIELD List_of_Names}{ IF { MERGEFIELD List_of_Names} = "" ""  " / ______" } unfortunately gives me the same problem; the underline appears at the end of the list, so it shows up only besides the last name.

I will be getting with the developer of our SQL database app to see if their variable can be modified as I now believe that the problem lies in how they are pulling the data and formatting it with the variable.  Thank you all for your help thus far.
SOLUTION
Avatar of Brian B
Brian B
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Glad to hear you found an solution. Please be sure to mark the answers you thought were helpful and then pick which post was the solution. (I think in this case, the solution is your own answer).
The problem lies in the way our program was developed and its construction of this document merge variable.  This particular variable pulls a list of selected names and separates them by <CR>.  Thus all names are pulled into the document prior to any code or formatting being applied at the end of the merge statement so the underline appears next to the last name only.  Placing the variable in a cell in a table ends up putting all the names in a single cell so again, only the last name in the list appears to have an underline next to it.

After checking with the developer this amounts to the best option available in Word.  While not totally automated, it makes it easier for users to add an underline at the end of  each name, should they want it.

Bottom line, there is no known Word option that would work with this variable and produce the desired results.  Only other option I have, which I will pursue, is to write my own SQL variable within the constraints of the program.