View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Require an If Mergefield Statement to import text into word2007 fi

{ IF { MERGEFIELD "fieldname" } = "good" { INCLUDETEXT "c:\\good.docx" } {
INCLUDETEXT "c:\\bad.docx" } }

You must use Ctrl+F9 to insert each pair of field delimiters { }

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Briza" wrote in message
...
Trying to write an if statement in word2007 for a mergefield whereby if
mergefield = "good" then insert the text (which is about 500 characters)
from
a word document located at c:\good.docx and if mergefield = "bad" then
insert
the text (which is also about 500 characters) from a word document located
at
c:\bad.docx

Can someone please write the if statement to do this?

Alternatively, could i use a notepad document instead of a word document
to
import text from (eg good.txt and bad.txt).
Thanks in advance