Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-14-2025, 03:38 PM
Formd Formd is offline Includepicture Windows 7 32bit Includepicture Office 2007
Advanced Beginner
Includepicture
 
Join Date: Feb 2015
Location: TX
Posts: 49
Formd is on a distinguished road
Default Includepicture

Hello
I am trying to insert an image while running mailmerge using the code below. The image inserts with no problem however I need help in eliminating the error and image box if there is no image found in the Path used. In my code below i removed the /d because I need the image placed in the document but not linked to the path because the file is forwarded to clients that do not have access to the path.

I am using the following:

HTML Code:
{If{INCLUDEPICTURE {IF TRUE “C:\\folder\\folder2\\{ClientN}_cdes.png”}}{INCLUDEPICTURE{IF TRUE “C:\\folder\\folder2\\{ClientN}_cdes.png”} }}
ClientN is the mergefield that changes for each file

An example of the file name is BAC-9842_cdes.png. BAC-9842 changes for each file.
Thanks

Appreciate your help.
Reply With Quote
  #2  
Old 01-14-2025, 07:17 PM
macropod's Avatar
macropod macropod is online now Includepicture Windows 10 Includepicture Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,369
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Unfortunately, Word's capacity regarding missing images is limited. The best solution is to ensure an image is available for each record - even a generic one that shows "Not on file", for example.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 01-16-2025, 10:26 AM
Formd Formd is offline Includepicture Windows 7 32bit Includepicture Office 2007
Advanced Beginner
Includepicture
 
Join Date: Feb 2015
Location: TX
Posts: 49
Formd is on a distinguished road
Default

I was trying something else to see if it works but it did not. I have a merge field that tells me how many images were created for the file. I tried using the following:

HTML Code:
{IF{Adimage} = 2 "{If{INCLUDEPICTURE {IF TRUE “C:\\folder\\folder2\\{ClientN}_cdes.png”}}{INCLUDEPICTURE{IF TRUE “C:\\folder\\folder2\\{ClientN}_cdes.png”} }"}
also tried

HTML Code:
{IF{Adimage} = "2" "{If{INCLUDEPICTURE {IF TRUE “C:\\folder\\folder2\\{ClientN}_cdes.png”}}{INCLUDEPICTURE{IF TRUE “C:\\folder\\folder2\\{ClientN}_cdes.png”} }"}

Adimage is the merge field that tells me how many images I have for the file.

Any advice?
Reply With Quote
  #4  
Old 01-16-2025, 12:41 PM
macropod's Avatar
macropod macropod is online now Includepicture Windows 10 Includepicture Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,369
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

For that, you'd use something like:
HTML Code:
{IF{MERGEFIELD Adimage} = "2" "{INCLUDEPICTURE "C:\\folder\\folder2\\{ClientN}_cdes.png"}"}
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 01-17-2025, 08:43 AM
Formd Formd is offline Includepicture Windows 7 32bit Includepicture Office 2007
Advanced Beginner
Includepicture
 
Join Date: Feb 2015
Location: TX
Posts: 49
Formd is on a distinguished road
Default

Perfect. Thank you
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Includepicture If...Then...Else with text included and INCLUDEPICTURE TCHook Mail Merge 3 01-25-2024 05:14 AM
Includepicture IncludePicture with Mergefield paluccie Mail Merge 3 03-13-2021 06:34 AM
Includepicture IncludePicture does not refresh the pictures ragesz Mail Merge 5 10-23-2020 03:41 AM
InCludePicture are strecthed VEA Word 3 06-20-2016 03:10 AM
Includepicture IncludePicture does not work in Mailmerge malalex Mail Merge 4 12-10-2013 07:09 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:35 AM.


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