Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Surpress Blank Line
I've looked through other posts but can't find a specific reference to what I
need to achieve - sorry if I missed it. I have an if statement that prints different text dependant upon the value in a merge field - see below {IF {MERGEFIELD COURSE_ID \*UPPER} = "JDP106" "We now wish you luck with your JDP Part 2 Activities." "{IF {MERGEFIELD COURSE_ID \*UPPER} = "JDP011" "We now wish you luck with your JDP Part 1 Activities." "" }} The "We now wish ........" is the only content of the line (25); my problem is that there is a third potential value (JDP206) in the merge field where I don't need to print anything and, in this case, need what is normally printed on line 27 to be printed on line 25 instead. Please see the following examples of the current and desired situation .................................................. .................................................. Current Example - Print from if statement Thank you for all the hard work ........ (line 23) We now wish you luck with your JDP Part 2 Activities. (line 25) Once again many congratulations. (line 27) .................................................. .................................................. Current Example - Nothing to print from if statement Thank you for all the hard work .......... (line 23) Once again many congratulations. (line 27) .................................................. .................................................. Desired Example - Nothing to print from if statement Thank you for all the hard work .......... (line 23) Once again many congratulations. (line 25) .................................................. .................................................. Thanks in advance for any help/solutions that are offered. Dave |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Surpress Blank Line
The following will work, provided you only press enter where you see ¶ as
the true line length will be affected by the message line length limits. It would be preferable to use inter paragraph spacing that pressing enter twice, but this will do what you asked. { IF{ MERGEFIELD COURSE_ID \*Upper} = "JDP106" "Thank you for all the hard work¶ ¶ We now wish you luck with your JDP Part 2 Activities.¶ ¶ Once again many congratulations " "{ IF { MERGEFIELD COURSE_ID \*Upper} = "JDP011" "Thank you for all the hard work¶ ¶ We now wish you luck with your JDP Part 1 Activities.¶ ¶ Once again many congratulations " "Thank you for all the hard work¶ ¶ Once again many congratulations " }"}¶ -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Dave C wrote: I've looked through other posts but can't find a specific reference to what I need to achieve - sorry if I missed it. I have an if statement that prints different text dependant upon the value in a merge field - see below {IF {MERGEFIELD COURSE_ID \*UPPER} = "JDP106" "We now wish you luck with your JDP Part 2 Activities." "{IF {MERGEFIELD COURSE_ID \*UPPER} = "JDP011" "We now wish you luck with your JDP Part 1 Activities." "" }} The "We now wish ........" is the only content of the line (25); my problem is that there is a third potential value (JDP206) in the merge field where I don't need to print anything and, in this case, need what is normally printed on line 27 to be printed on line 25 instead. Please see the following examples of the current and desired situation .................................................. ................................................. Current Example - Print from if statement Thank you for all the hard work ........ (line 23) We now wish you luck with your JDP Part 2 Activities. (line 25) Once again many congratulations. (line 27) .................................................. ................................................. Current Example - Nothing to print from if statement Thank you for all the hard work .......... (line 23) Once again many congratulations. (line 27) .................................................. ................................................. Desired Example - Nothing to print from if statement Thank you for all the hard work .......... (line 23) Once again many congratulations. (line 25) .................................................. ................................................. Thanks in advance for any help/solutions that are offered. Dave |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Surpress Blank Line
Thanks Graham, this worked a treat
"Graham Mayor" wrote: The following will work, provided you only press enter where you see ¶ as the true line length will be affected by the message line length limits. It would be preferable to use inter paragraph spacing that pressing enter twice, but this will do what you asked. { IF{ MERGEFIELD COURSE_ID \*Upper} = "JDP106" "Thank you for all the hard work¶ ¶ We now wish you luck with your JDP Part 2 Activities.¶ ¶ Once again many congratulations " "{ IF { MERGEFIELD COURSE_ID \*Upper} = "JDP011" "Thank you for all the hard work¶ ¶ We now wish you luck with your JDP Part 1 Activities.¶ ¶ Once again many congratulations " "Thank you for all the hard work¶ ¶ Once again many congratulations " }"}¶ -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Dave C wrote: I've looked through other posts but can't find a specific reference to what I need to achieve - sorry if I missed it. I have an if statement that prints different text dependant upon the value in a merge field - see below {IF {MERGEFIELD COURSE_ID \*UPPER} = "JDP106" "We now wish you luck with your JDP Part 2 Activities." "{IF {MERGEFIELD COURSE_ID \*UPPER} = "JDP011" "We now wish you luck with your JDP Part 1 Activities." "" }} The "We now wish ........" is the only content of the line (25); my problem is that there is a third potential value (JDP206) in the merge field where I don't need to print anything and, in this case, need what is normally printed on line 27 to be printed on line 25 instead. Please see the following examples of the current and desired situation .................................................. ................................................. Current Example - Print from if statement Thank you for all the hard work ........ (line 23) We now wish you luck with your JDP Part 2 Activities. (line 25) Once again many congratulations. (line 27) .................................................. ................................................. Current Example - Nothing to print from if statement Thank you for all the hard work .......... (line 23) Once again many congratulations. (line 27) .................................................. ................................................. Desired Example - Nothing to print from if statement Thank you for all the hard work .......... (line 23) Once again many congratulations. (line 25) .................................................. ................................................. Thanks in advance for any help/solutions that are offered. Dave |
#4
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Surpress Blank Line
Dave C,
If you ever decide to add more courses, and if you use Excel as your data source for the mail merge, you can set it up something like this, or alter your Excel Workbook as necessary. Then create a Word template and save for future use. It's based on what Mr. Mayor has already posted. You can create an Excel Workbook called "Employee Training". Sheet 1: Name it something like "Course Completion": Open Excel work sheet, and create a header row: A1 B1 C1 Employee Name Course ID Line 25 Text A2 B2 C2 John Doe JDP011 Jane Smith JDP106 Sam Spade JDP206 Dave C. JDP333 In C2 Put the following formula (This is all in one cell, watch the word wrap): =IF($A2="","",IF(VLOOKUP($B2,$F$2:$G$100,2)=0,"",I F(ISERROR(VLOOKUP($B2,$F$2:$G$100,2,0)),"Check Course Number",(VLOOKUP($B2,$F2:$G$100,2))))) This will allow you to add additional courses and what you want to fill in Line 25 with, up to 99 of them. You can change the range of VLookup to fit your needs. Use this formula in C2, and drag down the length of the column as needed. In the following Cells, fill in these values: F1 G1 Course ID Table Line 25 Table JDP011 We now wish you luck with your JDP Part 1 Activities. JDP106 We now wish you luck with your JDP Part 2 Activities. JDP206 Leave Blank JDP333 We now wish you luck with your JDP Part 3 Activities. (Added Course) Or create a separate worksheet with the Course ID & Line 25 Text Table call it "Course Table". A1 B1 Course ID Table Line 25 Table JDP011 We now wish you luck with your JDP Part 1 Activities. JDP106 We now wish you luck with your JDP Part 2 Activities. JDP206 Leave Blank JDP333 We now wish you luck with your JDP Part 3 Activities. (Example of Added Course) Use this formula in C2 on the Course Completion Sheet, and drag down the length of the column as needed. (This is all in one cell, watch the word wrap): =IF($A2="","",IF(VLOOKUP($B2,'Course Table'!$A$2:$B$100,2)=0,"",IF(ISERROR(VLOOKUP($B2, 'Course Table'!$A$2:$B$100,2,0)),"Check Course Number",(VLOOKUP($B2,'Course Table'!$A$2:$B$100,2))))) Save and close this Excel Workbook. Create a mailmerge letter, which you will later save as a document template. Link it with the Excel Workbook you just created as a Data Source. { MERGEFIELD "employee_name" } **Lines 1 thru 24 and use the following Mergefield if you mention the Course ID in this part of the letter, except for course "JDP206"** { IF { MERGEFIELD Line_25_Text } "" "{ MERGEFIELD "COURSE_ID" \* upper}" "" } ================================================== ========= Thank you for all the hard work ........ (line 23){ IF { MERGEFIELD Line_25_Text }= "" "" "¶ ¶{ MERGEFIELD Line_25_Text }" }¶ ¶ Once again many congratulations. (line 27) HTH Just an idea for future use. -- Add MS to your News Reader: news://msnews.microsoft.com Rich/rerat (RRR News) message rule Previous Text Snipped to Save Bandwidth When Appropriate "Graham Mayor" wrote in message ... The following will work, provided you only press enter where you see ¶ as the true line length will be affected by the message line length limits. It would be preferable to use inter paragraph spacing that pressing enter twice, but this will do what you asked. { IF{ MERGEFIELD COURSE_ID \*Upper} = "JDP106" "Thank you for all the hard work¶ ¶ We now wish you luck with your JDP Part 2 Activities.¶ ¶ Once again many congratulations " "{ IF { MERGEFIELD COURSE_ID \*Upper} = "JDP011" "Thank you for all the hard work¶ ¶ We now wish you luck with your JDP Part 1 Activities.¶ ¶ Once again many congratulations " "Thank you for all the hard work¶ ¶ Once again many congratulations " }"}¶ -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Dave C wrote: I've looked through other posts but can't find a specific reference to what I need to achieve - sorry if I missed it. I have an if statement that prints different text dependant upon the value in a merge field - see below {IF {MERGEFIELD COURSE_ID \*UPPER} = "JDP106" "We now wish you luck with your JDP Part 2 Activities." "{IF {MERGEFIELD COURSE_ID \*UPPER} = "JDP011" "We now wish you luck with your JDP Part 1 Activities." "" }} The "We now wish ........" is the only content of the line (25); my problem is that there is a third potential value (JDP206) in the merge field where I don't need to print anything and, in this case, need what is normally printed on line 27 to be printed on line 25 instead. Please see the following examples of the current and desired situation .................................................. ................................................. Current Example - Print from if statement Thank you for all the hard work ........ (line 23) We now wish you luck with your JDP Part 2 Activities. (line 25) Once again many congratulations. (line 27) .................................................. ................................................. Current Example - Nothing to print from if statement Thank you for all the hard work .......... (line 23) Once again many congratulations. (line 27) .................................................. ................................................. Desired Example - Nothing to print from if statement Thank you for all the hard work .......... (line 23) Once again many congratulations. (line 25) .................................................. ................................................. Thanks in advance for any help/solutions that are offered. Dave |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
numbering a document line-by-line SKIPPING blank lines... | Page Layout | |||
Mail Merge 2003 (surpress Blank Lines) | Microsoft Word Help | |||
In Word, how do I surpress headers and footers on page 2 | Microsoft Word Help | |||
How to surpress blank lines in merge | Mailmerge | |||
How to print blank merge data as a blank line? | Mailmerge |