Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-07-2022, 12:16 PM
orhancelil orhancelil is offline how to delete whole line if the merge field is empty Windows 10 how to delete whole line if the merge field is empty Office 2016
Novice
how to delete whole line if the merge field is empty
 
Join Date: Apr 2022
Posts: 2
orhancelil is on a distinguished road
Default how to delete whole line if the merge field is empty

Hello,



Please see below. I have two lines with two merge fields in the middle which are linked on my excel to two column.
The goal is, if one of the columns are empty in excel, merge needs to delete that line completely with all sentence without a line break on the text.
I tried to use /b trick on the mergefield code but it didnt worked. Anyone with any idea how to do ? I attached my both excel and word files.

Heading
You are «Age1» years old.
You are «Age2»years old.
Text text text
Text text


Goal :

Heading
You are 12 years old.
Text text text
Text text



Thanks a lot
Attached Files
File Type: docx merge word.docx (14.1 KB, 7 views)
File Type: xlsx merge excel.xlsx (8.4 KB, 4 views)
Reply With Quote
  #2  
Old 04-07-2022, 02:52 PM
macropod's Avatar
macropod macropod is offline how to delete whole line if the merge field is empty Windows 10 how to delete whole line if the merge field is empty 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

See Mailmerge Empty Line Suppression in the Mailmerge Tips and Tricks 'Sticky' thread at the top of this forum:
https://www.msofficeforums.com/mail-...ps-tricks.html
You can use the \b and \f switches together.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 04-07-2022, 03:56 PM
orhancelil orhancelil is offline how to delete whole line if the merge field is empty Windows 10 how to delete whole line if the merge field is empty Office 2016
Novice
how to delete whole line if the merge field is empty
 
Join Date: Apr 2022
Posts: 2
orhancelil is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
See Mailmerge Empty Line Suppression in the Mailmerge Tips and Tricks 'Sticky' thread at the top of this forum:
https://www.msofficeforums.com/mail-...ps-tricks.html
You can use the \b and \f switches together.
Oh thats a great content, thank you so much but i think i am soo dumb to solve. I am trying for 30mins every possible combinations but i didnt understand where to put f or b and which page break icon to get into the field, previous one or next one. So i tried all combinations like only f only b, b and f together etc etc but still line is not disappearing at all :/

Is it because i have text-merge field-text, is that mixing the mentioned logic on the guide?
Reply With Quote
  #4  
Old 04-07-2022, 04:20 PM
macropod's Avatar
macropod macropod is offline how to delete whole line if the merge field is empty Windows 10 how to delete whole line if the merge field is empty 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

For example:

Heading¶
{MERGEFIELD Age1 \b "You are " \f " years old.¶
"}{MERGEFIELD Age2 \b "You are " \f " years old.¶
"}Text text text¶
Text text¶
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to delete whole line if the merge field is empty I need to remove rows in a table where the Merge field is empty WordMonkey1 Mail Merge 2 10-28-2020 12:25 AM
how to delete whole line if the merge field is empty Mail merge: remove empty rows when a field is not showed Yarikh Mail Merge 4 09-23-2018 12:17 AM
how to delete whole line if the merge field is empty Delete Line of Bookmark if the Text is Empty ljg713 Word VBA 1 12-21-2015 04:27 PM
Delete paragraph base on merge field BenEWill Mail Merge 1 07-02-2014 02:52 PM
Mail Merge Empty Data Field Licos101 Mail Merge 2 04-10-2014 06:19 AM

Other Forums: Access Forums

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