Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Briza Briza is offline
external usenet poster
 
Posts: 8
Default Require an If Mergefield Statement to import text into word2007 fi

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
  #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



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Briza Briza is offline
external usenet poster
 
Posts: 8
Default Require an If Mergefield Statement to import text into word200

Thank you for the reply however it is not working.
Is it supposed to have 2 \\ for the location becuase I thought it would just
be c:\good.docx

Also can I use a notepad document instead (ie. .txt file)?
Thanks again.

"Doug Robbins - Word MVP" wrote:

{ 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




  #4   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 word200

You need either two \\ or one /

You should also be able to use a notepad (.txt) file.

--
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
...
Thank you for the reply however it is not working.
Is it supposed to have 2 \\ for the location becuase I thought it would
just
be c:\good.docx

Also can I use a notepad document instead (ie. .txt file)?
Thanks again.

"Doug Robbins - Word MVP" wrote:

{ 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






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
Mergefield statement help John Mailmerge 6 March 23rd 07 04:48 PM
Text does not print in narrow columns in a table - Word2007 Gary McC Tables 3 June 12th 06 05:06 PM
Use Mergefield within text in if-field Christine Mailmerge 1 November 14th 05 05:16 AM
How to program if statement in mergefield YaHootie Mailmerge 1 January 17th 05 12:34 PM
Insert carriage return in mergefield statement dixie Mailmerge 2 December 22nd 04 03:42 AM


All times are GMT +1. The time now is 05:44 PM.

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"