Solved

Variable Pictures in MS Word 2007/2010

Posted on 2012-04-03
6
430 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
  • 3
  • 2
6 Comments
 
LVL 9

Assisted Solution

by:damerval
damerval earned 500 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Do you ever need to create a 20 page Word document for some testing purpose? Are you tired of copying & pasting old boring "lorem ipsum" text over and over again, increasing font size and line space in order to make the document 20+ pages long? Look…
I'm writing to share my clumsy experience in using this elegant tool so you can avoid every stupid mistake I made. (I leave it to the authorities to decide if this deserves a place in the Knowledge archives.)  Now that I am on the other side of my l…
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.
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…

685 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