Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-27-2025, 10:52 PM
simotomaton simotomaton is offline mergefield within includepicture Windows 10 mergefield within includepicture Office 97-2003
Novice
mergefield within includepicture
 
Join Date: Feb 2025
Location: Australia
Posts: 3
simotomaton is on a distinguished road
Question mergefield within includepicture

I have been pulling my hair out trying to get a dynamic image to work in my merge. I've looked at numerous online 'answers' but have not had any actually work. This is my current code based on macropod's super helpful posts.

Quote:
{ IF { INCLUDEPICTURE { IF TRUE "\\\\server\\images\\{ MERGEFIELD Area_Code}.emf" } \d} {INCLUDEPICTURE { IF TRUE ""\\\\server\\images\\{ MERGEFIELD Area_Code }.emf" } \d} }
But I'm still getting "Error! Unknown op code for conditional." when I run my merge.
It has been tricky to test, as my merge is run by an application I use at work which generates the merge data on the fly, then sends the result to a printer (or pdf).

My image source is a network address. I don't have access to the local drives the software that is running the merge is on. I have tested that it has access to the network location using a direct link (ie no mergefield in the filename).

All my {} are created with Ctrl+F9.



Any help would be amazing, otherwise I'll be back to using 44 different merge templates, one for each area
Reply With Quote
  #2  
Old 02-27-2025, 11:27 PM
macropod's Avatar
macropod macropod is offline mergefield within includepicture Windows 10 mergefield within includepicture Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,360
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

Your field code is incorrect. The old method no longer works.

See the Managing Mailmerge Graphics topic on the Mailmerge Tips & Tricks page: https://www.msofficeforums.com/mail-...ps-tricks.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 03-04-2025, 06:17 PM
simotomaton simotomaton is offline mergefield within includepicture Windows 10 mergefield within includepicture Office 97-2003
Novice
mergefield within includepicture
 
Join Date: Feb 2025
Location: Australia
Posts: 3
simotomaton is on a distinguished road
Default

Thanks for the reply, but I'm still unclear what I code should be using. You mention that the 'old' method no longer works, does that apply to Word pre-2007?

I have read the post you link to and concluded that I should try
Quote:
{INCLUDEPICTURE {IF TRUE "\\\\server\\Images\\{MERGEFIELD Area_Code}.emf"} \d}
The outcome was just blank; no image included, but also no error.

I also noticed in the post that you mention adding a macro, however I am unable to do this due to application restrictions. I'm not clear wether the macro is neccesary for the images to work.

I'm starting to think it is a quirk of the application running the merge.
Reply With Quote
  #4  
Old 03-04-2025, 06:33 PM
macropod's Avatar
macropod macropod is offline mergefield within includepicture Windows 10 mergefield within includepicture Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,360
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

I'm not sure whether the old approach will work with W0rd 97-2003. If so, you'd use a field code like:
{INCLUDEPICTURE "\\\\server\\images\\{ MERGEFIELD Area_Code}.emf" \d}
or:
{IF{IF TRUE "\\\\server\\images\\{ MERGEFIELD Area_Code}.emf" {INCLUDEPICTURE "\\\\server\\images\\{ MERGEFIELD Area_Code }.emf" \d}}
However, you may need to include the full path to the images folder, not just the server name.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 03-10-2025, 08:23 PM
simotomaton simotomaton is offline mergefield within includepicture Windows 10 mergefield within includepicture Office 97-2003
Novice
mergefield within includepicture
 
Join Date: Feb 2025
Location: Australia
Posts: 3
simotomaton is on a distinguished road
Default

Thanks, but I'm still not getting anything when I run the merge.

I'm suspecting it's due to the fact that the merge runs via a third party application and prints directly to the printer.

I thought I'd try the very inelegant method of embedding the images in a whole lot of nested IF statements to avoid any issues it might have been having accessing the files. But even that didn't work. It would be blank when I ran the merge direct to a printer. It would however display the image if I run the merge and view it as a Word doc, but unfortunately I need to have it work straight to the printer.

I understand a macro might help with updating the images, but the application I'm using doesn't allow macros

I might have to just give up, unless you have any ideas why just inserting images inline into nested IF statements wouldn't be printing?

Thanks
Reply With Quote
  #6  
Old 03-12-2025, 03:25 PM
macropod's Avatar
macropod macropod is offline mergefield within includepicture Windows 10 mergefield within includepicture Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,360
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

Given that you're merging direct to printer, you might be able to get the desired results with just:
{INCLUDEPICTURE "\\\\server\\images\\{ MERGEFIELD Area_Code }.emf"}
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
mail-merge, ms-word

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
mergefield within includepicture Includepicture Formd Mail Merge 4 01-17-2025 08:43 AM
Inserting a table as a mergefield, similar to INCLUDEPICTURE beldel Mail Merge 0 11-11-2021 01:45 PM
mergefield within includepicture IncludePicture with Mergefield paluccie Mail Merge 3 03-13-2021 06:34 AM
InCludePicture are strecthed VEA Word 3 06-20-2016 03:10 AM
mergefield within includepicture Printing selected pages based on a MERGEFIELD.g. If MERGEFIELD=x then print pages 1,2,4 if MERGEFIEL Richard.p Word 3 04-21-2015 01:14 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:59 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