Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / August 2004

Tip: Looking for answers? Try searching our database.

Change merge document based on condition

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Hefe311 Jen - 10 Aug 2004 17:55 GMT
Hello,

I have a merge letter that includes a table with merge fields in it.  I
wanted to know if I could delete that table and add another table based on
one of the fields in my data source.  Similar situations are in other
threads, but not where you actually replace a table with another table based
on a condition, so I'm not sure if this would even be possible.  

Any ideas?
Peter Jamieson - 10 Aug 2004 18:12 GMT
Well, you wouldn't delete one table and add another, so much as use an IF
field to decide whether to use one chunk of text+fields+tables+anything else
rather than another.

e.g. if you normally want table A but when Mergefield X is "Y" you don't
want table A but you do want table B, you could use

{ IF { MERGEFIELD X } = "Y"
"insert table B here"
"insert table A here" }

Signature

Peter Jamieson

> Hello,
>
[quoted text clipped - 5 lines]
>
> Any ideas?
Hefe311 Jen - 10 Aug 2004 19:11 GMT
So do both tables print out on the document?  From your reply it doesn't
sound like it, but I guess I'm confused as to where table B would hang out
until MERGEFIELD = "N".

> Well, you wouldn't delete one table and add another, so much as use an IF
> field to decide whether to use one chunk of text+fields+tables+anything else
[quoted text clipped - 17 lines]
> >
> > Any ideas?
Peter Jamieson - 10 Aug 2004 20:52 GMT
> So do both tables print out on the document?

No.

> From your reply it doesn't
> sound like it, but I guess I'm confused as to where table B would hang out
> until MERGEFIELD = "N".

Think of it like this. If you have

before{ IF { MERGEFIELD X } = "Y" "A" "B" }after

then in your output, if X is "Y" you will see

beforeAafter

(B isn't in the output)

and if X is not "Y" you will see

beforeBafter.

(A isn't in the output)

All you are really doing is putting a whole table instead of A and another
one instead of B. Generally speaking, any fields inside the table that is
displayed will be evaluated. However, do not assume that fields in B will
not be evaluated just because the results are thrown away - some field types
such as SEQ may in fact be executed. I don't know why.

Signature

Peter Jamieson

> So do both tables print out on the document?  From your reply it doesn't
> sound like it, but I guess I'm confused as to where table B would hang out
[quoted text clipped - 21 lines]
> > >
> > > Any ideas?

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.