Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 999
  • Last Modified:

How do you add text after a mergefield point?

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
model_un
Asked:
model_un
  • 11
  • 8
1 Solution
 
DrTribosCommented:
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
 
model_unAuthor Commented:
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
 
DrTribosCommented:
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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
model_unAuthor Commented:
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
 
DrTribosCommented:
Ok. It is 2am here. Anyone else feel free to answer (just saying) otherwise I'll look in about 8 hrs.
0
 
model_unAuthor Commented:
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
 
model_unAuthor Commented:
Come on Experts Exchange... don't fail me now... I know I'm missing something simple here...

FF
0
 
DrTribosCommented:
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
 
DrTribosCommented:
C'mon Fernando... don't fail the Experts... would love to help you close this out :-)
0
 
model_unAuthor Commented:
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
 
DrTribosCommented:
Looking now
0
 
DrTribosCommented:
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
 
DrTribosCommented:
See this...
Hope it helps.
merge-sample.docx
0
 
model_unAuthor Commented:
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
 
DrTribosCommented:
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
 
model_unAuthor Commented:
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
 
DrTribosCommented:
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
 
model_unAuthor Commented:
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
 
DrTribosCommented:
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 11
  • 8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now