#1
|
|||
|
|||
Conditional INCLUDETEXT based on data merge
Please forgive me if this has already been addressed, but I have looked high and low for the solution I need.
I want to pull text from a document based on data that merges from a CSV. While I have been able to find where I can do this by using If/Then statements, I do not want to type the conditions in the source documents itself. Basically, I need this to work the same as a conditional includeimage. So, I have images in the source folder as {includepicture { if true "{mergefield LIST_ID}.png}" \d} so that the logo is placed in the document based on the list id that is imported. Each logo is named the same as the list id (123.png) I tried {includetext { if true "{mergefield LIST_ID}.doc}" \d} to no avail. I simply got a blank space. I hope this makes sense. I was able to find the answer there for that problem, and hope I can get the answers I need for this, too. |
#2
|
||||
|
||||
You can use a simple IncludeText field but you need the path and double slashes e.g.
{ INCLUDETEXT "C:\\Path\\{ MERGEFIELD LIST_ID }.doc" } The \d switch is not applicable to IncludeText fields
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
Thank you. I put in { INCLUDETEXT "C:\\Users\\kara\\Documents\\My Circulation\\Renewals\\{ MERGEFIELD LIST_ID }.doc" } I get Error! Bookmark not defined.
|
#4
|
||||
|
||||
What EXACTLY is in the field LIST_ID and what is the name of the associated document?
Did you use CTRL+F9 for the bracket pairs?
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#5
|
|||
|
|||
The LIST_ID is a number. This number comes from the lists in which the CSV is made from. When the CSV is merged with the document, the source needs to look at the LIST_ID to determine which address to pull in. The documents are named the same as the LIST_ID. For example, if one list is 123, then there is a document named 123.doc.
Yes, I used Alt+F9 to create the brackets. Thank you for your help. |
#6
|
|||
|
|||
Now, I have tried adding bookmarks to the document, which only consists of a simple address. I am still getting the Error! Bookmark not defined error. I have no clue what I am doing wrong. No matter what I put in, I get that error.
|
#7
|
|||
|
|||
Finally, I got this to work with: { INCLUDETEXT "C:\\Path\\{ MERGEFIELD LIST_ID }.doc" }. I have no idea why it decided to work this morning, but it did. Thank you!
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Conditional format a button based off a value in a field | Triscia | Misc | 0 | 03-11-2015 11:12 AM |
Conditional Image insertion based on Merge Data | Kavo | Mail Merge | 2 | 02-26-2015 08:39 AM |
Conditional Formatting based on dynamic Date | Modifier1000 | Excel | 2 | 09-12-2014 08:53 AM |
Conditional Formatting based on Value of Another Cell | SteveBump | Excel | 3 | 03-07-2014 09:16 AM |
Conditional color fill based on presence of data | avanderh | Excel | 11 | 07-28-2011 09:10 AM |