Solved

Variable Pictures in MS Word 2007/2010

Posted on 2012-04-03
6
426 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
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…

867 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now