Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Sam Sam is offline
external usenet poster
 
Posts: 68
Default Using IF statements to Insert a File

Hi All

I'm looking for some information/advice on writing an IF statement (or
whatever will work best) here is the back ground info:

I'm writing a mail merge document to send out to our vendors asking them to
sign on to our automated invoicing system. There are many different parts of
our company, with separate trading ABN's so I need to have the vendor sign a
separate legal document for each area.

I want to insert the relevant legal document into the letter depending on
whether or not the vendor detals with that area of our business.

E.g:
Vendor A deals with Iron Ore, Petroleum and Coal so I want to insert the
file for the legal document for each.

Vendor B deals with only Iron Ore and Petroleum so I only want to insert the
file for those 2.

I was trying to write an If statement along the lines of

{IF {MERGEFIELD A} = "Iron Ore" "{INCLUDETEXT "C:\RCTI\io.doc"
\*MERGEFORMAT}" ""}

But I'm not sure how to get this to look at all the different variables,
I've tried nesting the IF statements but it seems to get completely confused
and doesn't pull back the right data.

I'm using Excel 2003 as a data source and Word 2003 for the letter.

Thanks

Sam.

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Using IF statements to Insert a File

As general rules,
a. double up backslashes in file paths in fields (c:\\RCTT\\io.doc) (or you
may find using single forward slashes works better). Also, unchecking Word
Tools|Options|General|Web Options|Files|Update links on save can prevent
Word from changing paths in some field types)
b. remove \*Mergeformat (unless it is the only thing that makes your
includetexts work) and ensure that you do not have formatting/style clashes
between your including and included documents (e.g. if you have a style
called "abc", it should bedefined the same way in both documents)
c. you may need to eliminate the final paragraph mark (which contains
section formatting) in your included files, by marking the entire file
except the final paragraph mark with a bookmark - called say, "almostall".
Then use

{ INCLUDETEXT "C:\\RCTI\\io.doc" almostall }

c. nest the other way around, e.g.

{ INCLUDETEXT "{ IF "{ MERGEFIELD A }" = "Iron Ore" "C:\RCTI\io.doc" "some
other path name with an empty document" }" almostall }

(Obviously, you have to get your IF field logic right as well!)

Peter Jamieson

"Sam" wrote in message
...
Hi All

I'm looking for some information/advice on writing an IF statement (or
whatever will work best) here is the back ground info:

I'm writing a mail merge document to send out to our vendors asking them
to
sign on to our automated invoicing system. There are many different parts
of
our company, with separate trading ABN's so I need to have the vendor sign
a
separate legal document for each area.

I want to insert the relevant legal document into the letter depending on
whether or not the vendor detals with that area of our business.

E.g:
Vendor A deals with Iron Ore, Petroleum and Coal so I want to insert the
file for the legal document for each.

Vendor B deals with only Iron Ore and Petroleum so I only want to insert
the
file for those 2.

I was trying to write an If statement along the lines of

{IF {MERGEFIELD A} = "Iron Ore" "{INCLUDETEXT "C:\RCTI\io.doc"
\*MERGEFORMAT}" ""}

But I'm not sure how to get this to look at all the different variables,
I've tried nesting the IF statements but it seems to get completely
confused
and doesn't pull back the right data.

I'm using Excel 2003 as a data source and Word 2003 for the letter.

Thanks

Sam.



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I insert Adobe Acrobat File (multiple pages) into Word doc Brent Microsoft Word Help 4 August 20th 12 08:35 PM
when I insert file into my document, the footer in file disappear Elizabeth New Users 2 September 24th 06 06:10 PM
Insert File via Drop Down Option Sprint54 Microsoft Word Help 1 April 18th 06 12:50 AM
Insert Word file without losing the VBA code MervB Microsoft Word Help 1 September 14th 05 03:38 AM
Insert Picture from File Problem pas926 Microsoft Word Help 2 January 4th 05 03:07 AM


All times are GMT +1. The time now is 11:48 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"