Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-11-2019, 02:58 AM
gizmo83 gizmo83 is offline Mail Merge Suppression issue Windows 10 Mail Merge Suppression issue Office 2019
Novice
Mail Merge Suppression issue
 
Join Date: Jul 2019
Posts: 3
gizmo83 is on a distinguished road
Default Mail Merge Suppression issue

Hello,



I have a dataset which includes several criteria for Mail merge. However, those which contain a zero value should not be included in the merge, and the line they exist on should be suppressed to ensure good formatting. However, I am unable to achieve this.

Essentially, it's this.

The data is in Excel, with Field name, and field value)

Field Name 1: £100 (this should be included)
Field Name 2: £0 (this should be suppressed)
Field Name 3: £120 (this should be included)
*Just to add, the title (shown as Field Name 1 etc.) also needs to be suppressed.

Is there anything I can do to achieve the desired outcome?

Thank you so much for any help!
Gio
Reply With Quote
  #2  
Old 07-11-2019, 04:29 AM
gmayor's Avatar
gmayor gmayor is offline Mail Merge Suppression issue Windows 10 Mail Merge Suppression issue Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You could use a series of conditional fields e.g as follows. Use CTR+F9 for the bracket pairs and press the enter key where you see ¶

{ IF { MERGEFIELD "Field Name 1"} > 0 "Field Name 1: { MERGEFIELD "Field Name 1" \# "£.0"}¶
"}{ IF { MERGEFIELD "Field Name 2"} > 0 "Field Name 2: { MERGEFIELD "Field Name 2" \# "£.0"}¶
"}{ IF { MERGEFIELD "Field Name 3"} > 0 "Field Name 3: { MERGEFIELD "Field Name 3" \# "£.0"}¶
"}
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 07-11-2019, 07:23 AM
gizmo83 gizmo83 is offline Mail Merge Suppression issue Windows 10 Mail Merge Suppression issue Office 2019
Novice
Mail Merge Suppression issue
 
Join Date: Jul 2019
Posts: 3
gizmo83 is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
You could use a series of conditional fields e.g as follows. Use CTR+F9 for the bracket pairs and press the enter key where you see ¶

{ IF { MERGEFIELD "Field Name 1"} > 0 "Field Name 1: { MERGEFIELD "Field Name 1" \# "£.0"}¶
"}{ IF { MERGEFIELD "Field Name 2"} > 0 "Field Name 2: { MERGEFIELD "Field Name 2" \# "£.0"}¶
"}{ IF { MERGEFIELD "Field Name 3"} > 0 "Field Name 3: { MERGEFIELD "Field Name 3" \# "£.0"}¶
"}
Thank you! Do I insert each line relevant to the merge field name, or is this as one piece of code in the category head
Reply With Quote
  #4  
Old 07-11-2019, 08:16 PM
gmayor's Avatar
gmayor gmayor is offline Mail Merge Suppression issue Windows 10 Mail Merge Suppression issue Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You insert all of it where you want the result to appear. It will show those fields and their leading texts where the values are greater than 0
{ IF { MERGEFIELD "Field Name 1"} > 0 "Field Name 1: { MERGEFIELD "Field Name 1" \# "£,0"}
"}{ IF { MERGEFIELD "Field Name 2"} > 0 "Field Name 2: { MERGEFIELD "Field Name 2" \# "£,0"}
"}{ IF { MERGEFIELD "Field Name 3"} > 0 "Field Name 3: { MERGEFIELD "Field Name 3" \# "£,0"}
"}

You can use Import and export field constructions as text if you wish to convert the text above to fields (change the text as appropriate)
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #5  
Old 07-12-2019, 12:08 AM
gizmo83 gizmo83 is offline Mail Merge Suppression issue Windows 10 Mail Merge Suppression issue Office 2019
Novice
Mail Merge Suppression issue
 
Join Date: Jul 2019
Posts: 3
gizmo83 is on a distinguished road
Default

Thanks again.

When I do as instructed, the result is that the word MERGEFIELD appears - but no other information, neither with or without preview results selected. Clearly I am faulting somewhere - any ideas?
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Merge Suppression issue Mail Merge Code Issue Andrewwill Mail Merge 6 01-06-2018 10:25 PM
Mail Merge Suppression issue Mail merge repeating decimals issue jmorris33 Mail Merge 2 01-10-2015 11:54 PM
Mail Merge Formatting Issue with Conditional IFs robbeh Mail Merge 5 07-08-2014 07:39 AM
time field issue in mail merge Aude Mail Merge 16 05-18-2014 06:22 AM
Word 2007 mail merge issue steelervince Mail Merge 0 02-17-2010 02:26 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:18 AM.


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