Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-18-2023, 10:00 AM
Ben Ben is offline Creating a merge template with between 1 and 4 variables built into a rule Windows 11 Creating a merge template with between 1 and 4 variables built into a rule Office 2021
Novice
Creating a merge template with between 1 and 4 variables built into a rule
 
Join Date: Jul 2023
Posts: 1
Ben is on a distinguished road
Default Creating a merge template with between 1 and 4 variables built into a rule

Hello,

I am working on a template and need to know how to add multiple merge fields to a sentence without causing a bunch of extra commas and periods if only 1 of the fields gets filled.



We are sending letters as reminders to pay bills, and each person will have between 1 and 4 bills that need to be listed.

If I add all 4 of the merge fields to the sentence in the template, the spacing, commas, and "and" get left at the end of the sentence (if they have fewer than 4 bills)

How can I make a rule to prevent this conjunction and punctuation pileup?

Thank you
Reply With Quote
  #2  
Old 07-18-2023, 05:59 PM
Guessed's Avatar
Guessed Guessed is offline Creating a merge template with between 1 and 4 variables built into a rule Windows 10 Creating a merge template with between 1 and 4 variables built into a rule Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

This is called concatenation and requires nested fields using If fields. See Making your mail merge “intelligent” by using IF fields for an example.

Depending on where you are getting your source data for the merge (eg Microsoft Access), it may be simpler to build a SQL query there which uses the CONCAT function to do the tricky stuff so that the Word Mail Merge simply grabs that result. Threads like the following might give you clues (or keywords you can search further on).
Concatenate fields and insert comma between: how to handle nulls – SQLServerCentral Forums
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Resetting the Normal Template - Getting default built-in styles - do not show up in the Organizer herosz Word 2 03-16-2022 01:14 PM
Creating Template - Macro/Mail Merge/VBA? mwilburn01 Word 3 09-13-2018 05:24 AM
Creating a merge template with between 1 and 4 variables built into a rule Mail Merge in Word: creating a rule for blanks cgranada Mail Merge 6 02-27-2017 09:08 AM
Creating new documents from a mail merge template pnjcarter Mail Merge 1 02-03-2014 06:42 PM
Creating a merge template with between 1 and 4 variables built into a rule How to access all built-in styles for a template? ChrisBrewster Word 1 01-23-2014 07:00 PM

Other Forums: Access Forums

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