Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-15-2022, 08:54 AM
Ozzyy Ozzyy is offline Removing Blank Conditional Sections in Mail Merge if Condition is not Met Windows 10 Removing Blank Conditional Sections in Mail Merge if Condition is not Met Office 2019
Novice
Removing Blank Conditional Sections in Mail Merge if Condition is not Met
 
Join Date: May 2021
Posts: 4
Ozzyy is on a distinguished road
Default Removing Blank Conditional Sections in Mail Merge if Condition is not Met

Hello –



I have an Excel to Word mail merge set up with some conditional sections. I’ve got the conditions all working well, but am struggling with having Word skip over blank rows if the condition is not met. My goals are:
  • for Word to show a series of fields (each on a new row) if the condition is met, and
  • for Word to not show any blank spaces if this condition is not met

Here is a simplified example of the logic I’m working with:
STATIC TEXT HERE

{ if {MERGEFIELD Bonus Amount} = 0 “” {MERGEFIELD Annual Salary}}
{ if {MERGEFIELD Bonus Amount} = 0 “” {MERGEFIELD Bonus Rate}}
{ if {MERGEFIELD Bonus Amount} = 0 “” {MERGEFIELD Bonus Amount}}

MORE STATIC TEXT HERE

Sample desired output if condition is met:
STATIC TEXT HERE

60,000
10%
6,000

MORE STATIC TEXT HERE

Sample desired output if condition is not met:
STATIC TEXT HERE
MORE STATIC TEXT HERE

Current output if condition is met (this is working as I want):
STATIC TEXT HERE

60,000
10%
6,000

MORE STATIC TEXT HERE

Current output if condition is not met (I can’t figure out how to remove the blank rows):
STATIC TEXT HERE





MORE STATIC TEXT HERE

---
Any assistance on how to remove those blank rows when the condition is not met would be greatly appreciated. Thanks!!
Reply With Quote
  #2  
Old 05-15-2022, 06:18 PM
macropod's Avatar
macropod macropod is offline Removing Blank Conditional Sections in Mail Merge if Condition is not Met Windows 10 Removing Blank Conditional Sections in Mail Merge if Condition is not Met Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

That's as simple as:
{IF{MERGEFIELD Bonus Amount}<> 0 "{MERGEFIELD Annual Salary}¶
{MERGEFIELD Bonus Rate}¶
{MERGEFIELD Bonus Amount}"}
where the ¶ is a paragraph break or manual line break.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 05-15-2022, 07:22 PM
Ozzyy Ozzyy is offline Removing Blank Conditional Sections in Mail Merge if Condition is not Met Windows 10 Removing Blank Conditional Sections in Mail Merge if Condition is not Met Office 2021
Novice
Removing Blank Conditional Sections in Mail Merge if Condition is not Met
 
Join Date: May 2021
Posts: 4
Ozzyy is on a distinguished road
Default

That worked - thank you! I'd forgotten that multiple merge fields can be included within quotation marks - that seemed to be key to resolving this issue.

Really appreciate your help!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing Blank Conditional Sections in Mail Merge if Condition is not Met Suppressing Blank Conditional Sections in Mail Merge Ozzyy Mail Merge 3 05-08-2021 04:31 PM
Removing Blank Conditional Sections in Mail Merge if Condition is not Met Conditional Text without Mail Merge wvdh Word 3 10-05-2017 02:38 AM
Mail merge in sections with address list patrickpetersen Mail Merge 1 02-18-2015 10:57 PM
Mail Merge - Filters adding condition not originally specified bobcharest Mail Merge 11 06-13-2014 11:03 PM
Removing Blank Conditional Sections in Mail Merge if Condition is not Met Conditional merge fields in mail merge Aude Mail Merge 1 01-06-2012 07:38 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:15 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