Mail Merge Question

Hi,

The 1st 6 lines of a Word form document are mail merge address fields.  (Name, Title, Organization, Addr 1, Addr 2, City,St,Zip)

Some of the addresses in the data list use up 3 lines, some use 4, 5 or all 6 fields. After the mail merge is run, if an address field is not used, it is left out of the document (which is what I want).

I’d like to keep the 6 mail merge address fields at the top of the document and have the rest of the document ALWAYS start at exactly 2.5 inches from the top of the page, regardless of how many lines are used for the address.   I don't want the placement of the remainder of the document to be dependent upon the length of the address section.

I can not use a text box to do this since a related macro for filing files will not recognize the address if I use a text box

I was wondering if an  “if, then” function that says if there are only 3 lines of text in the address section, add 3 blank lines, if there are 4 lines of text in the address, add 2 blank lines, etc. would work?  Can you provide the command to do this in the merge form document?

If possible, I would like to solve this without using a macro.  Thank you for any assistance in this matter!

Craig

How about using a borderless table with the row height fixed for the address merge fields and have the text start below the table.
Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thanks for your idea...

before I put the time into it, quick questions....have you ever tried this before successfully and/or are you fairly confident this will solve the issue?


thanks again!


eager to try this but just thought I'd ask before trying....

Craig

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Yes, I have used borderless tables with fixed height rows on many occasions to control layout.


Also, as the following code will refer to the first paragraph in the first cell of the table if the Table is the first thing in the body of the document:


ActiveDocument.Range.Paragraphs(1).Range


Therefore, unless you macro use some obscure coding, it should work.


However, if you are wanting to split the merged document into individual files, you may want to consider using the Merge to Individual Docs facility on the MergeTools – 20130627 Add-in that I created that you can download from the following page of my Windows Live SkyDrive:

https://skydrive.live.com/?cid=5aedcb43615e886b#!/?cid=5AEDCB43615E886B!cid=5AEDCB43615E886B&id=5AEDCB43615E886B%21566

Save the file in the Word Startup folder.  In Windows XP the default location for that folder is

C:\Documents and Settings\[User Name]\Application Data\Microsoft\Word\STARTUP

In Windows Vista and Windows 7, it is

C:\Users\[User Name]\AppData\Roaming\Microsoft\Word\STARTUP

When you have done that, the tab shown below will be added to the Ribbon:




One thing to note is that the field names in your data source must contain only alphanumeric characters (No @,#,$,%,&,(,), etc) and the field names must not start with a numeric character (0-9).


Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thanks so much!!!..i'm sure this will be very helpful..


eager to try this soon!


Craig

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

It worked great but now I have another problem


if the address doesn’t use all 6 lines, there will be awkward spaces:

 

Name

 

 

Address 1

 

City, State ZIP

 


Under the old method without a table, if this 6 address fields were not in a table, the address with only 3 lines would appear as (which looks good):

 

Name

Address 1

City, State ZIP

 

 

So, is there a way to make the 3 line address appear like it used to still  have the rest of the document always start at the same point?

 Thank you for any insight, help on this!

Craig

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Use a one row table with all of the mergefields in the one cell.
Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Use a one row table with all of the mergefields in the one cell.


You'd need to do rather more than that. Even with the fields in one cell, you risk having blank lines in that cell.

 

Suppose, for example, you have the following fields:

«Title» «FirstName» «LastName»
«CompanyName»
«Address1»
«Address2»
«City», «State» «Zip»

and any of «FirstName», «CompanyName», «Address1» and/or «Address2» could be empty. To handle that, you can use the \b and/or \f switch to conditionally insert the required space & line/paragraph breaks.

 

Here's how to do it using just the \f switch:

 

First, delete the space after «FirstName» and delete the paragraph/line breaks after each of «CompanyName», «Address1» and «Address2».

 

Next, select all the fields and press Shift-F9 to expose the field codes. You should (ignoring any line-wrapping imposed by this site) see:

{Mergefield Title} {Mergefield FirstName }{Mergefield LastName}
{Mergefield CompanyName}{Mergefield Address1}{Mergefield Address2}{Mergefield City}, {Mergefield State} {Mergefield Zip}

 

Now, edit the fields so you end up with:

{Mergefield Title} {Mergefield FirstName \f " "}{Mergefield LastName}
{Mergefield CompanyName \f "¶
"}{Mergefield Address1 \f "¶
"}{Mergefield Address2 \f "¶
"}{Mergefield City}, {Mergefield State} {Mergefield Zip}

where the ¶ symbols are real paragraph/line breaks.

 

Finally,  select all the fields and press F9 to update the fields. Your mailmerge is now ready to run.

Cheers
Paul Edstein
(Fmr MS MVP - Word)

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

That could be, but Craig said that under the old method without a table, if this 6 address fields were not in a table, the address with only 3 lines would appear as (which looks good):

 

Name

Address 1

City, State ZIP


and what he wanted was to force the text in the body of the document to start at the same place regardless of the number of lines in the address.


My suggestion was to use a borderless table with a fixed row height, intending that it just be a one row table.  However, it appears that Craig may have had a row for each of the address lines, which resulted in the spaces between Name, Address1 and City, State Zip.

Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Yes, the one row solution worked with a fixed height on the row  thanks so much!

Craig


Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated October 5, 2021 Views 221 Applies to: