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 / June 2005

Tip: Looking for answers? Try searching our database.

Conditional Merge with Tables.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andrew Minor - 13 Jun 2005 16:17 GMT
Hi,

I'm using Word 2000 and I'm trying to work out how to do a merge
whereby a table is printed dependant on a condition.  The pseudo-code
is:

  If (Mergefield(a) = "BACS") or (Mergefield(a) = "") then

  ----------------------------------
  |     Table goes here            |
  |--------------------------------|
  |       multiple rows            |
  |--------------------------------|
  |                                |
  ----------------------------------

  Else

     ' Print nothing at all, not even a blank line.

  End If

The "If..Then..Else" Word merge field doesn't seem to help as I can't
paste formatted text into the relevant places in the dialog box.

I'm sure I was able to do this in WP5.1 for DOS so I MUST be able to
do this in Word 2000.  Am I missing something particularly obvious?

Can anyone advise?

Thanks

Andrew Minor
Peter Jamieson - 13 Jun 2005 18:34 GMT
> The "If..Then..Else" Word merge field doesn't seem to help as I can't
> paste formatted text into the relevant places in the dialog box.

Don't try to paste formatted text into the dialog box. Make sure you are in
the view where you can see the field codes, e.g.

{ IF { MERGEFIELD a } = "BACS"
""
""
}

then paste the table cells directly between the relevant quotes. You will
not be able to avoid having extra paragraphs around the table, but when the
result is "" you should not have any extra lines at all.

If you really need IF a = "BACS" or a = "", you can't use an "or" in the IF
field in the way you have shown. You can do it using a bit more nesting,
e.g.

{ IF { ={ COMPARE "{ MERGEFIELD a }" = "BACS" }+{ COMPARE "{ MERGEFIELD a }"
= "" } } > 0 "put your table here" "" }

> I'm sure I was able to do this in WP5.1 for DOS so I MUST be able to
> do this in Word 2000.

In the general case, that ain't necessarily so, although I believe you
should be able to do what you want in this case.

> Am I missing something particularly obvious?

I don't think so.

Peter Jamieson

> Hi,
>
[quoted text clipped - 29 lines]
>
> Andrew Minor

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.