Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
{ 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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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 | |
|
|
![]() |
||||
Thread | Forum | |||
Mergefield statement help | Mailmerge | |||
Text does not print in narrow columns in a table - Word2007 | Tables | |||
Use Mergefield within text in if-field | Mailmerge | |||
How to program if statement in mergefield | Mailmerge | |||
Insert carriage return in mergefield statement | Mailmerge |