Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-04-2015, 06:44 AM
Kavo Kavo is offline Conditional INCLUDETEXT based on data merge Windows 8 Conditional INCLUDETEXT based on data merge Office 2013
Novice
Conditional INCLUDETEXT based on data merge
 
Join Date: Feb 2015
Posts: 7
Kavo is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old 05-04-2015, 07:03 AM
gmayor's Avatar
gmayor gmayor is offline Conditional INCLUDETEXT based on data merge Windows 7 64bit Conditional INCLUDETEXT based on data merge Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #3  
Old 05-04-2015, 07:43 AM
Kavo Kavo is offline Conditional INCLUDETEXT based on data merge Windows 8 Conditional INCLUDETEXT based on data merge Office 2013
Novice
Conditional INCLUDETEXT based on data merge
 
Join Date: Feb 2015
Posts: 7
Kavo is on a distinguished road
Default

Thank you. I put in { INCLUDETEXT "C:\\Users\\kara\\Documents\\My Circulation\\Renewals\\{ MERGEFIELD LIST_ID }.doc" } I get Error! Bookmark not defined.
Reply With Quote
  #4  
Old 05-04-2015, 10:03 PM
gmayor's Avatar
gmayor gmayor is offline Conditional INCLUDETEXT based on data merge Windows 7 64bit Conditional INCLUDETEXT based on data merge Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #5  
Old 05-05-2015, 06:57 AM
Kavo Kavo is offline Conditional INCLUDETEXT based on data merge Windows 8 Conditional INCLUDETEXT based on data merge Office 2013
Novice
Conditional INCLUDETEXT based on data merge
 
Join Date: Feb 2015
Posts: 7
Kavo is on a distinguished road
Default

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.
Reply With Quote
  #6  
Old 05-06-2015, 11:07 AM
Kavo Kavo is offline Conditional INCLUDETEXT based on data merge Windows 8 Conditional INCLUDETEXT based on data merge Office 2013
Novice
Conditional INCLUDETEXT based on data merge
 
Join Date: Feb 2015
Posts: 7
Kavo is on a distinguished road
Default

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.
Reply With Quote
  #7  
Old 05-08-2015, 07:44 AM
Kavo Kavo is offline Conditional INCLUDETEXT based on data merge Windows 8 Conditional INCLUDETEXT based on data merge Office 2013
Novice
Conditional INCLUDETEXT based on data merge
 
Join Date: Feb 2015
Posts: 7
Kavo is on a distinguished road
Default

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!
Reply With Quote
Reply

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 INCLUDETEXT based on data merge 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 INCLUDETEXT based on data merge Conditional color fill based on presence of data avanderh Excel 11 07-28-2011 09:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:39 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft