Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-10-2025, 01:46 PM
KarinG KarinG is offline Remove First Blank Line in Mailmerge Windows 11 Remove First Blank Line in Mailmerge Office 2021
Novice
Remove First Blank Line in Mailmerge
 
Join Date: Apr 2025
Posts: 3
KarinG is on a distinguished road
Default Remove First Blank Line in Mailmerge

Hi Everyone!
I have my mailmerge all figured out except one last part.
If my very first IF is blank it inserts a blank line. So if MergeFiled M_29 is blank, then I get a blank line showing up. I have managed to get rid of all the other blank lines if any of the other fields are blank, just not the first one.
This is my code:
Mailmerge.jpg
Any suggestions would be appreciated.
Thanks.


Karin
Reply With Quote
  #2  
Old 04-10-2025, 03:09 PM
macropod's Avatar
macropod macropod is offline Remove First Blank Line in Mailmerge Windows 10 Remove First Blank Line in Mailmerge Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Use:
{IF{MERGEFIELD M29}<> "" "•→Ostomy Supplies¶
"}{IF{MERGEFIELD M30}<> "" "•→Incontinence Supplies¶
"}{IF{MERGEFIELD M31}<> "" "•→Catheter Supplies¶
"}{IF{MERGEFIELD M32}<> "" "•→Injection Supplies¶
"}{IF{MERGEFIELD M34}<> "" "•→Burn Scar Garments¶
"}{IF{MERGEFIELD M35}<> "" "•→Custom Made Compression Garments¶
"}{IF{MERGEFIELD M36}<> "" "•→Ready Made Compression Garments¶
"}{IF{MERGEFIELD M37}<> "" "•→Back and Abdominal/Inguinal Hernia Supports¶
"}{IF{MERGEFIELD M16A}<> "" "•→Pediatric Benchmark Equipment¶
"}{IF{MERGEFIELD M39}<> "" "•→Bathing and Toileting Aids (Small)¶
"}{IF{MERGEFIELD M39A}<> "" "•→Stationary Commodes¶
"}{IF{MERGEFIELD M40}<> "" "•→Walking Aids and Accessories¶
"}{IF{MERGEFIELD M42}<> "" "•→Bathing and Toileting Aids (Large)¶
"}{IF{MERGEFIELD M43}<> "" "•→Slings Benchmark¶
"}{IF{MERGEFIELD M58}<> "" "•→Mattress Overlays, Transfer Aids and Accessories¶
"}
without a paragraph break following the last field.

For a macro to convert the above field code representations into working field codes, see Convert Text Representations of Fields to Working Fields in the Mailmerge Tips and Tricks 'Tickiy' thread at the top of this forum: https://www.msofficeforums.com/mail-...ps-tricks.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 04-11-2025, 10:15 AM
KarinG KarinG is offline Remove First Blank Line in Mailmerge Windows 11 Remove First Blank Line in Mailmerge Office 2021
Novice
Remove First Blank Line in Mailmerge
 
Join Date: Apr 2025
Posts: 3
KarinG is on a distinguished road
Default

Thank you Paul! I had the paragraph markers in the wrong spot.

The issue I am having now is the sentence following the IF structure. The items in the IF are indented. If I remove the paragraph marker after the last field, then the sentence after the IF structure is also indented. If I leave the paragraph marker in then the next sentence is not indented but I have a blank line. I don't want a blank line and I don't want the next line indented.

Any ideas?
Reply With Quote
  #4  
Old 04-15-2025, 08:25 AM
KarinG KarinG is offline Remove First Blank Line in Mailmerge Windows 11 Remove First Blank Line in Mailmerge Office 2021
Novice
Remove First Blank Line in Mailmerge
 
Join Date: Apr 2025
Posts: 3
KarinG is on a distinguished road
Default

That worked.
Thanks!
Reply With Quote
  #5  
Old 04-11-2025, 03:43 PM
macropod's Avatar
macropod macropod is offline Remove First Blank Line in Mailmerge Windows 10 Remove First Blank Line in Mailmerge Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

If you apply the indented paragraph formatting to each of the paragraph breaks within the field construction, but not to the paragraph following it, your sentence after the field shouldn't be indented. It may be easier to do that setup before deleting the paragraph break that follows the fields.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove First Blank Line in Mailmerge How can I delete a blank line with Word VBA if it is followed by another blank line? jamu Word VBA 9 04-11-2022 04:21 PM
Remove First Blank Line in Mailmerge Delete comma and space after blank merged value. Also remove Previous space and word before blank Alex1s85 Mail Merge 4 01-18-2020 11:30 PM
Remove First Blank Line in Mailmerge Mailmerge sends sometimes with text and others in blank yoyoauba Mail Merge 6 01-23-2019 07:53 AM
Remove First Blank Line in Mailmerge Remove blank table rows AFTER mailmerge Formd Mail Merge 5 05-11-2018 03:43 PM
Remove First Blank Line in Mailmerge Need help on Macro 03- Find text - if text is blank then remove line simpleonline1234 Word VBA 1 02-25-2011 02:28 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:12 PM.


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