Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-26-2012, 07:03 PM
bekz bekz is offline Help with a complex mail merge Windows Vista Help with a complex mail merge Office 2007
Novice
Help with a complex mail merge
 
Join Date: Mar 2012
Posts: 4
bekz is on a distinguished road
Unhappy Help with a complex mail merge

Hi everyone. I have a very tricky piece of work to complete. I've put the hours in and come up with my template in word for the mail merge. It all works and is looking good. The only problem is there are some parts that I do not want to show up (and therefore print off) if the value of a particular data field is nothing. This is very hard to explain, so I have attached a pdf which (hopefully) illustrates what I am after. If you can help I would be very grateful.
Attached Files
File Type: zip Mail Merge help.zip (1.23 MB, 13 views)
Reply With Quote
  #2  
Old 03-26-2012, 08:38 PM
macropod's Avatar
macropod macropod is offline Help with a complex mail merge Windows 7 64bit Help with a complex mail merge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi bekz,

This is easily done by embedding the entire 3rd page in an IF field coded like:
{IF«DFKEY1»<> "" "The entire 3rd page"}
To do this, simply insert a «DFKEY1» mergefield at the start of the 3rd page, then select the entire 3rd page, then press Ctrl-F9 to enclose it in a pair of field braces, so that you get something like {«DFKEY1»'The entire 3rd page'}. Then add the remaining text that makes up the IF test, including the double-quotes before & after the 3rd page's content. Be careful to inlcude the spaces shown in the field construction.

If, as I suspect, you have a page break at the end of the 2nd page, you'll need to include that in the field as well. The simplest way of doing that is to insert another field into the expression, thus: {IF«DFKEY1»<> "" "{QUOTE 12}The entire 3rd page"}, then delete the actual page break at the end of the 2nd page. When you're done, press F9 to update the field code, then run your mailmerge.

Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste them from this message. Likewise, you can't type or copy & paste the chevrons (ie '« »') - they're part of the actual mergefields, which you can insert from the mailmerge toolbar.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 05-02-2012, 07:55 PM
bekz bekz is offline Help with a complex mail merge Windows Vista Help with a complex mail merge Office 2007
Novice
Help with a complex mail merge
 
Join Date: Mar 2012
Posts: 4
bekz is on a distinguished road
Default Sorry for the massive delay

I got very frustrated with this and nearly threw the computer out the window. I've had a nice long break from it, and coming back with fresh eyes it's making sense and working...kind of.

When I key in the required coded fields I manage to get all the information to disappear. The first question is, how do I see it again if I want to change it because it's wrong? I can't actually see the IF field information...

The second question is, I have tested it with my data. I have found one of the few entries that contain a value for DFKEY1, however when I view the merged data, the information does not return for this entry. As therre is information in DFKEY1 for the entry, I would have expected for all of "the entire third page" to come back with the appropriate information inserted into the merged fields. Bit confused now... lol
Reply With Quote
  #4  
Old 05-02-2012, 08:14 PM
macropod's Avatar
macropod macropod is offline Help with a complex mail merge Windows 7 64bit Help with a complex mail merge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi bekz,

You can view the field coding via Alt-F9.

If you're only previewing the merge, the display won't reliably reflect the output - you'll need to actually finish the merge to see what you'll get.

If you can post some sample data, plus your latest version of the document, I'll take a look at it for you. It may be a day or two, though, as I'm busily working on a uni assignment.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 05-03-2012, 05:30 PM
bekz bekz is offline Help with a complex mail merge Windows Vista Help with a complex mail merge Office 2007
Novice
Help with a complex mail merge
 
Join Date: Mar 2012
Posts: 4
bekz is on a distinguished road
Default Very appreciated

I would love it if you could take a look! I don't mind how long it takes! Any help would be great. I have completed the merge and viewed the data, however it doesn't show up with the additional information when the DFKEY1 HAS data in it. I'm very confused. Have a look when you have time and let me know what you think. Please note that the data file (excel) I have given you is just a sample - there are 470 in my real file. Also, I have changed the information for privacy, so if you refer to any information, please just refer to the merged fields.
Attached Files
File Type: xlsx False Information Data.xlsx (82.8 KB, 13 views)
File Type: docx Help with this one.docx (70.6 KB, 16 views)
Reply With Quote
  #6  
Old 05-03-2012, 08:26 PM
macropod's Avatar
macropod macropod is offline Help with a complex mail merge Windows 7 64bit Help with a complex mail merge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi bekz,

See attached. You'd omitted a space in the DFKEY1 IF test. It's the little things that get you.

Also, you had the DFKEY1 field's IF test embedded in the DFKEY2 field's IF test, meaning that the DFKEY1 field's output could only ever display if the DFKEY2 field's output was displayed. Plus, with the field coding you had, there'd be two page breaks before the DFKEY1 field's output displayed, but none between it and the DFKEY1 field's output. As it appears the DFKEY1 field's output is meant to be positioned ahead of the DFKEY2 field's output, I've simply moved the whole of the DFKEY1 field (including its IF test) so that it occurs before the DFKEY2 field and its IF test.
Attached Files
File Type: docx bekz.docx (101.7 KB, 20 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 05-06-2012, 07:10 PM
bekz bekz is offline Help with a complex mail merge Windows Vista Help with a complex mail merge Office 2007
Novice
Help with a complex mail merge
 
Join Date: Mar 2012
Posts: 4
bekz is on a distinguished road
Default Genius

Thank you so so so so much! I don't know what I would have done without your help. Safe to say I would definately have less hair after tearing chunks out.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with a complex mail merge Complex array formula andrei Excel 9 02-03-2012 03:40 AM
Help with a complex mail merge Conditional merge fields in mail merge Aude Mail Merge 1 01-06-2012 07:38 PM
Help with a complex mail merge From a beginner: Mail Merge using Windows Mail mhalpern705 Mail Merge 3 12-16-2011 04:58 AM
Help with a complex mail merge Complex Find and Replace paulkaye Word 1 11-13-2011 04:23 AM
Help with a complex mail merge Saving INDV mail merges During the mail merge sedain121 Mail Merge 2 10-04-2011 07:52 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:03 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft