Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Variable Pictures in MS Word 2007/2010

Posted on 2012-04-03
6
Medium Priority
?
433 Views
Last Modified: 2012-04-11
I have an application that uses MS Word (2007 & 2010) for mail merges.  What I want is to embed a dynamic photo based on a field in the datasource.   The field contains a url to the end users photo.  ie.  FieldName: photolocation
Field Value  http://www.hostingsite/user.jpg

I have used the following without success.

{INCLUDEPICTURE "{IF TRUE { MERGEFIELD «photolocation» }}"}

Result:   Displays "http://www.hostingsite/user.jpg" and not the embedded picture.

Explicit Example  (tried with and without quotes around URL:
{INCLUDEPICTURE "{IF TRUE { "http://www.hostingsite/user.jpg” }}"}

Any help would be greatly appreciated.
Thanks in advance.
0
Comment
Question by:ulcsupport
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 9

Assisted Solution

by:Philippe Damerval
Philippe Damerval earned 1500 total points
ID: 37802472
Hi,
There is a bug in Word 2007/2010 that Microsoft is aware of regarding the IncludePicture field. If you save your document as a word 97-2003 file, you will get better results.
Also, make sure all the pointers and details from this link:
http://wordnut.hubpages.com/hub/IncludePicture
are taken into account. I have just run an example using some random images from a google search, and it seems to work. The doubling up of the slashes is important.

HTH,

Philippe
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 37802553
It's not clear what the IF field is there for. Try this:

{INCLUDEPICTURE “{ MERGEFIELD «photolocation» }”}
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 37803058
Sorry. I have mixed up the views.

It should just be
{INCLUDEPICTURE “«photolocation»”}

or with the Mergefield code displayed:
{INCLUDEPICTURE “{ MERGEFIELD photolocation }”}
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Accepted Solution

by:
ulcsupport earned 0 total points
ID: 37816132
I was able to find a solution to this.   The coding solutions were correct,  however, it was necessary to do a CRL-A to select all fields and then F9 to update the merge fields.   This worked only when saving in Word 2003 format.  I was not successful getting this to work in Office 2007/2010, apparently due to a known bug.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 37816488
The merge process itself should automatically update fields, so I doubt that was the real answer, though it may account for the strange-looking field codes that you reported in the question.

What bug prevents merge from working in Word 2007?  Perhaps we can find a workaround.
0
 

Author Closing Comment

by:ulcsupport
ID: 37831656
I was able to find a solution to this.   The coding solutions were correct,  however, it was necessary to do a CRL-A to select all fields and then F9 to update the merge fields.   This worked only when saving in Word 2003 format.  I was not successful getting this to work in Office 2007/2010, apparently due to a known bug.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Authors who set out to write any sort of lengthy piece for online submission—be it a long question or comment on a technical form, an article, or a substantial blog entry—often find it useful to work up a draft in an editor other t…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question