Re: Mergefields, IF statements and section breaks
- From: "macropod" <macropod@xxxxxxxxxxxxxxx>
- Date: Fri, 18 Jul 2008 08:31:00 +1000
Hi JAnderson,
I think you'll get the results you're after if you make the first character of each of the 'animal' documents a continuous Section break and if you insert a continuous Section break in your mailmerge document after the mergefields also. Alternatively, if you want each of the 'animal' documents to start on a new page, and the mailmerge document to resume on a new page after that, make the section breaks 'next page'.
--
Cheers
macropod
[MVP - Microsoft Word]
"JAnderson" <JAnderson@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:3B22563B-AE16-4860-964C-54DA69587602@xxxxxxxxxxxxxxxx
Ah, that makes sense, thank you. It looks like the last of my problems is
formatting.
Each of my documents has different page setup dimensions (margins,
header/footer, etc.), by they seem to take on that of the main "host"
document, rather than keeping their original formatting. I can't think of a
way around this, but everything else is looking pretty good.
Any ideas? Thanks as always,
"Graham Mayor" wrote:
The point of the exercise was that you don't need the conditional
statements. The Includetext field inserts the appropriate document. And yes
you can put mergefields in the included documents and they will work
provided they match the fields in your data source.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
JAnderson wrote:
> Hmm... So could I still use conditional statements with INCLUDETEXT?
> If my database record is 'zebra', I only want my zebra document to
> show.
>
> Also, would includetext retain formatting? It's important that I keep
> margins, footers, and text formatting in a certain way.
>
> Lastly, can INCLUDETEXT also accommodate mergefields? For example,
> inside my zebra document are mergefields like 'zoo name' 'zoo
> address' 'zoo city', etc., which merge from my database. This works
> inside IF statements, but I wonder if it would with INCLUDETEXT...
>
> Thanks,
>
> "macropod" wrote:
>
>> Hi JAnderson,
>>
>> You'd probably get better results by creating a separate reference
>> document for each scenario, then embedding your MERGEFIELD within an
>> INCLUDETEXT field pointing to the folder where those documents can
>> be found.
>>
>> For example, suppose your refrence documents are in the folder C:\My
>> Documents\Animals and you have a series of files (eg Bear.doc,
>> Zebra.doc, etc) in that folder. In that case you could use an
>> INCLUDETEXT field coded as: {INCLUDETEXT "C:\\My
>> Documents\\Animals\\{MERGEFIELD ANIMAL}.doc"}
>>
>> Now, if you add a new 'Animal' to your database, all you need to do
>> is to create a corresponding reference document for it in the folder
>> C:\My Documents\Animals.
>>
>> --
>> Cheers
>> macropod
>> [MVP - Microsoft Word]
>>
>>
>> "JAnderson" <JAnderson@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:D72A9CA1-3AE0-4CF1-B857-DFC75769E8BE@xxxxxxxxxxxxxxxx
>>> Ok, this is a somewhat complicated one, so bear with me:
>>>
>>> I have a large document where each page is an "IF" statement
>>> followed by a next-page section break. Let's pretend that I'm
>>> using the merge field "Animal" as my condition:
>>>
>>> {IF{MERGEFIELD_ANIMAL}= "BEAR" "
>>> Document relating to bears
>>> More text, formatting of 0.5" margins
>>> More text
>>> ---section break (next page)---
>>> " ""}
>>> {IF{MERGEFIELD_ANIMAL}= "ZEBRA" "
>>> Document relating to zebras
>>> More text, formatting of 1" margins
>>> More text
>>> ---section break (next page)---
>>> " ""}
>>> BEGIN REGULAR 2-PAGE DOCUMENT
>>> More text, 1.2" margins
>>> More text
>>> End of document
>>>
>>> Thus, if the condition "Bear" is met, then a document relating to
>>> bears will become part of my document, otherwise, nothing happens
>>> (the false condition is ""). Likewise, if "Zebra" is the value of
>>> the field, then a document about zebras appears. Under any
>>> condition, however, my "regular" document is always part of the
>>> merge (say, a fact *** about zoo animals).
>>>
>>> This method, while potentially inelegant, works for our specific
>>> needs, and works without any problems. However, there becomes a
>>> point where inserting one more "IF" statement will "break" the
>>> whole document.
>>>
>>> Say I realize that I need to add yet another document about Lions,
>>> so I follow the formatting above and enter this Lion IF statement
>>> right after the zebra IF statement. For some reason, headers,
>>> footers and margins (section break qualities) will not be correct
>>> for whatever document I merge, and sometimes the "next page"
>>> section breaks will reorient themselves as "continuous", thus
>>> melding pages together.
>>>
>>> I'm a bit stuck at this point, because I can't understand why, if a
>>> section break is within an IF statement, it would later become
>>> functional even though its condition is not met. Would it be more
>>> effective if, every time I added a new IF statement, I re-built the
>>> whole document starting with "Bear", then "Zebra", then "Lion",
>>> then "Regular document"? Is this just a lost cause?
>>>
>>> (The reason I am insistent on doing it this way is because, on a
>>> grander scale, I do not want to have hundreds of individual
>>> documents to use for merging data; I would prefer to have one
>>> 'master' document.)
>>>
>>> Thanks in advance,
.
- Follow-Ups:
- Re: Mergefields, IF statements and section breaks
- From: JAnderson
- Re: Mergefields, IF statements and section breaks
- References:
- Mergefields, IF statements and section breaks
- From: JAnderson
- Re: Mergefields, IF statements and section breaks
- From: macropod
- Re: Mergefields, IF statements and section breaks
- From: JAnderson
- Re: Mergefields, IF statements and section breaks
- From: Graham Mayor
- Re: Mergefields, IF statements and section breaks
- From: JAnderson
- Mergefields, IF statements and section breaks
- Prev by Date: Re: Novice needs help with cosolidating in mailmerge document
- Next by Date: Re: mail merger = blank document!
- Previous by thread: Re: Mergefields, IF statements and section breaks
- Next by thread: Re: Mergefields, IF statements and section breaks
- Index(es):