Solved

How do you add text after a mergefield point?

Posted on 2014-03-18
19
628 Views
Last Modified: 2014-03-26
Hi all,

I am setting up a mail merge with data coming from an excel worksheet. One letter per family with variable activities per family. I was able to set up the merge perfectly with introductory text before the "merged" data. But for the life of me I cannot add text to point after the "merged" data.

Any ideas welcomed.

Fernando
how-to-add-merge-text.docx
0
Comment
Question by:model_un
  • 11
  • 8
19 Comments
 
LVL 14

Expert Comment

by:DrTribos
ID: 39938805
I don't really understand your question.  I guess you want to add some standard text after the merge, like:  yours sincerly, Fernando

I would have thought you can simply type the text into your document exactly where you want it.

You might benefit from turning on field codes.  Press:
Alt + F9
Also in word options set field shading to always.
0
 

Author Comment

by:model_un
ID: 39939220
Sorry. Yes. I need to add approximately three paraghraphs of text after the last line of data. But every attempt to do so has resulted in merge errors. I could cut and paste each one, but with 200 letters, I would prefer not to have to resort to that.

Thanks,

FF
0
 
LVL 14

Expert Comment

by:DrTribos
ID: 39939641
Um... it should be fairly straight forward.  Did you use the Alt + F9 to toggle field codes?
Can you pls upload a sample doc and spreadsheet and indicate where you want fields and text?
0
 

Author Comment

by:model_un
ID: 39939720
Thanks DrTribos. I uploaded the sample letter. I did toggle the field codes, But if I add text to end of the "mergefields" I get the same text at the end of EACH line of the variable information. Does this make sense?

The basic format is:

1 paragraph (standard text)

2 paragraph (variable text coming from Excel)

3 paragraph (standard text and closing)

Unfortunately all of my attempts to add text after the variable text, results in the text being placed at the end of EACH variable text sentence.

So if a family has three lines of text coming from Excel, then they get the closing three times in the merge.

I'm going to upload what a final letter should look like.

FF
DOC031914.pdf
0
 
LVL 14

Expert Comment

by:DrTribos
ID: 39939751
Ok. It is 2am here. Anyone else feel free to answer (just saying) otherwise I'll look in about 8 hrs.
0
 

Author Comment

by:model_un
ID: 39939796
This is the mergefield set up I have:

{If {mergeseq} = “1” {mergefield envelope}



{ date \@ “MMMM d, yyyy”}


Dear { mergefield family} Family:

These are the points we have on file:

Date (tab) Activity (tab) Points Earned “ “”}{ Set place1 { mergefield family}}
{ if {place2} <> {place1}”


--------------------------------- Page Break --------------------------------


{ mergefield envelope}


{ date \@ “MMMM d, yyyy”}


Dear { mergefield family} Family:

These are the points we have on file:

Date (tab) Activity (tab) Points Earned
{ mergefield date} {mergefield tab}{mergefield activity} {mergefield tab}{mergefield points} “ “{ mergefield date} {mergefield tab}{mergefield activity} {mergefield tab}{mergefield points}”}{set place2 {mergefield family}}
0
 

Author Comment

by:model_un
ID: 39939831
Come on Experts Exchange... don't fail me now... I know I'm missing something simple here...

FF
0
 
LVL 14

Expert Comment

by:DrTribos
ID: 39940927
Sorry more questions than anwswers,

Perhaps some of the questions will guide you on track...

Your PDF shows a single page but your comment seems wrong... why are you repeating information after the page break.  The information before and after the page break looks different but almost the same.

My request was:
Can you pls upload a sample doc and spreadsheet and indicate where you want fields and text?

It does not have to have real data, just want to see what you are doing... can't tell from the PDF.

Are you using the Step by Step Mail Merge Wizard?  Mailings > Start Mail Merge (dropdown) > Step by Step Wizard...

Then you simply use Insert Merge Field.

Also, I'd probably try to do letters and envelopes separately... I don't know what your { mergefield envelope } is supposed to do.
{If {mergeseq} = “1” {mergefield envelope}
As far as I can tell there is a problem here... { Mergeseq }
Please see this Microsoft article, Microsoft article, in short you are only going to satisfy the condition for the very first item in your mail merge.

I am not sure about this bit either: {set place2 {mergefield family}}  
set place 2 - is it a field code?

Not sure about: “ “{ mergefield date} {mergefield tab}{mergefield activity} {mergefield tab}{mergefield points}”}
quotation marks - what are you trying to achieve here?

Cheers,
0
 
LVL 14

Expert Comment

by:DrTribos
ID: 39947279
C'mon Fernando... don't fail the Experts... would love to help you close this out :-)
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:model_un
ID: 39947977
Sorry DrTribos. I got pulled away for a few days... let's see if we can't get this issue resolved.

Firstly. The purpose again of this merge is to create individual family letter, incorporating data regarding activities they have participated in that is stored in Excel. Each letter has the same base text, with the exception of the "activities" being pulled. Of course some have more than others.

The base coding for this comes from the Microsoft KB/294686 (How to use mail merge to create a list sorted by category in Word):

{ If { MERGESEQ } = "1" "{ MERGEFIELD CITY }¶
" ""}{ SET Place1 { MERGEFIELD CITY }}¶
{ If { Place2 } <> { Place1 }"¶
----------------------------Page Break--------------------------------
{ MERGEFIELD CITY }¶

{ MERGEFIELD EMPLOYEE } { MERGEFIELD SALES }" "{ MERGEFIELD EMPLOYEE } { MERGEFIELD SALES }" }{ SET Place2 { MERGEFIELD CITY }}¶

Of course my is modified to my needs. Like for instance, the inclusion of the "envelope" field, which actually refers to the  "Families" envelope the letter is going into... is sorting helper, nothing to do with a real envelope.

As far as using the mail merge wizard, yes and no. Yes I use it to set up the basic structure (actually use the Directory function), but once that is done, you have to enter the mergefields myself.

Now. As I've mentioned. I can get a perfect mailmerge dones. With the family names and family specific content included, each on a separate page.

The only problem is I cannot figure out how to a signature line below the incorporated text. Of course this closing paragraph and signature line will be on all the letters. But in all my attempts the text that I want to include get add to EACH new line of incorporated text.

So instead of

Opening Text

Incorporated Text
Incorporated Text
Incorporated Text

Closing text

I'm getting

Opening Text

Incorporated Text   Closing text
Incorporated Text   Closing text
Incorporated Text   Closing text

Get the picture...

I'll upload the letter and some sample data, but again I don't have a problem with the merging side of this... its how to manipulate the mergefields in order to function properly.

Thanks again!
merge-sample.docx
2013-2014-Master-Data-sample.xlsx
0
 
LVL 14

Expert Comment

by:DrTribos
ID: 39947993
Looking now
0
 
LVL 14

Expert Comment

by:DrTribos
ID: 39948011
OK I think there are a few issues... almost all of your text is inside fields... that is most likely why you don't see it.  The fields seem complex and I think there are some errors.  

Pg 1 has an If field {IF <Condition>, DisplayTrue, DisplayFalse } that includes:

Condition = { Mergeseq } = "1"

DisplayTrue = { MergeField Envelope } {Date \@ "MMMM d, yyyy" } Dear { mergefield city } Family: These are the PVC ... school year:

DisplayFalse = <nothing>

Open in new window


I think this is not working because MergeSeq "1" is line 2 (using headers) in your spreadsheet... thus it will only be true once.  It looks like you want to include data from lines 2-4 in 1 mailing, 5-6 in another mailing, and so on for 7-9, 10-11, 12-13, 14-16 etc. and this is why you are using the: If Mergeseq = 1??

The 2nd If field actually spans 2 pages... with a page break in the middle of it.

In the spreadsheet, I think you need to get all the achievements on the same line as the envelope.

Did you turn on field shading and set to always...
0
 
LVL 14

Expert Comment

by:DrTribos
ID: 39948022
See this...
Hope it helps.
merge-sample.docx
0
 

Author Comment

by:model_un
ID: 39953158
Thanks Dr.Tribos.

The merge sample you uploads, Should I be able to "see" mergefield, It looks like an output page only.

I think what I'm going to do is to put all the "standard" text before the point totals, that way I can by-pass the problem area.

Thanks again, I can't believe that this would be such a complicated task to achieve. I can't be the first to have to create this type of document.

Oh well.

Best,

FF
0
 
LVL 14

Accepted Solution

by:
DrTribos earned 500 total points
ID: 39954488
Try select all: ctrl + a
Then show fields: alt +F9

When you do this make sure word options are set to show field codes always.

Do this on both versions of the document. You will see that your text is inside the field codes.

Going forward:
Write the contents first then put in the codes
Do a second merge for the envelopes
0
 

Author Comment

by:model_un
ID: 39956421
Thanks DrTribos.

When I do the merge I get one continuos word document. With multiple families per page, not the seperate pages that I need.

I've gone ahead and reformatted the letter to meet the restrictions that I faced.

Quite unfortunate that Word in not more accomodating.

Oh well.

I'll go ahead and award you the points give the effort and time spent. But we are left with the mystery of how to add text after the mergecodes.

Best and thanks again.

Fernando
0
 
LVL 14

Expert Comment

by:DrTribos
ID: 39957580
Thanks Fernando,

I think your main obstacle is not being able to see the merge fields... and not being able to tell if your text is inside or outside of one.  Your document had a fairly complex field nest in it.  The settings that I have recommended will help you see what is happening in the background.

Ctrl + A followed by Alt + F9 should reveal the codes, they are in brackets...  { Field Code }

Your document has nested fields { Field 1 {Field 2} }

and nests inside nests { Field 1 {Field 2} { Field 3 {Field 4}}}

The following will be unlikely to work:
Dear { Field 1: <If Something> {Field 2: Fernando} Thank you for your help with: { Field 3: Class A } on {Field 4: 2014/03/27 }Kind regards, DrTribos}

Instead you need something like:
Dear Field 1: <If Something> {Field 2: Fernando} Thank you for your help with: { Field 3: Class A } on {Field 4: 2014/03/27 }} Kind regards, DrTribos

In word, with shading on you can see exactly what is in and out of the field codes, hope this helps some.
0
 

Author Comment

by:model_un
ID: 39957830
Indeed. I have turned on the "always show field codes" options and this helps. But no matter were I put the "extra" text, inside or out of the field codes, I'm still getting the wrong output.

Thanks again,

Fernando
0
 
LVL 14

Expert Comment

by:DrTribos
ID: 39958082
You're welcome.

Me thinks, start fresh - perhaps with a simpler document.  I think what you are trying to achieve is quite complex if this is something you have not done much of...

Cheers,
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Introduction Authors who set out to write any sort of lengthy piece for online submission—be it a long question or comment on a technical form, an article, or a substantial blog entry—often find it useful to work up a draft in an editor other t…
Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now