Created On:  21 September 2011

Problem:

When Document Factory-generated Word document (in XML format) is distributed to other users, they are unable to view the images within the document. Only an empty placeholder for the image is shown. The screenshot below is such an example.



How do we embed the images into the Document Factory output?

Resolution:

To resolve this problem, the solution is to generate the Document Factory output in .doc format. The screenshot below shows the selection of .doc format instead of .xml format. This will ensure that the images are automatically embedded in the document.



If you need to generate the Document Factory output in .xml format, you will have to carry out additional steps as described below to embed the images in the document.

In Word 2003:
1. Open the generated document in Microsoft Word 2003
2. Click the Edit menu to display the sub-menu
3. Click on the 'Links...' option to display the 'Links' dialog
4. Select all the images. You can use CTRL+Click or SHIFT+Click to select multiple images.
5. Check "Save picture in document"
6. Click "OK"
7. Save the document

In Word 2007:
1. Open the generated document in Microsoft Word 2007
2. Click the Office button
3. Click the Prepare menu option to display sub-menu
4. Click the 'Edit Links to Files' menu option to display the 'Links' dialog
5. Select all the images. You can use CTRL+Click or SHIFT+Click to select multiple images.
6. Select (check) the Option "Save picture in document"
7. Click "OK"
8. Save the document

A screenshot of the Links dialog:



After applying this setting, the saved document will have the images embedded within the document. The limitation with this technique is that one has to apply this setting once for every Document Factory report that needs to be distributed.

In Microsoft Word 2010, the changes required are similar to Word 2007. The not so obvious part is locating the Prepare menu. By default, the Prepare menu is not displayed. To enable the display of the Prepare menu, you may refer to the article http://www.addictivetips.com/microsoft-office/prepare-word-2010-document-for-distribution-prepare-menu/

Related Article

This article talks about the scenario where the user generating the report is able to view the images on his or her own computer but when distributed to other user, the latter is not able to view the images.

There is another scenario whereby the user generating the report is not able to view the images on his or her own computer. If this is the observed behavior, please refer to the article "Microsoft Word 2007 only displays folder file path the image cache instead of actually showing the image shown in the caliber description field" for possible solution.

In-depth discussion of the problem

This section gives a more in-depth discussion of the problem and is optional.

If you are generating a Document Factory report in .xml format, the images that exist in the retrieved requirements are not embedded in the Word document on generation of the document. Instead, they are only referenced in the document. To verify this, one can enable the Microsoft Word option 'Show field codes instead of their values' to display the reference (or field codes) instead of the picture. Below is an example of such a reference.

{ INCLUDEPICTURE  \d "C:\\Users\\mfuser\\AppData\\Local\\Borland\\CaliberRM\\IMageCache\\EF2C66F8-5C81-9565-7F69-C73D776712EA.png" \* MERGEFORMATINET }

In the extract above, note that the image file, EF2C66F8-5C81-9565-7F69-C73D776712EA.png, resides in the folder C:\\Users\\mfuser\\AppData\\Local\\Borland\\CaliberRM\\IMageCache\\.
 
On the computer where the report is generated, this image file would have been downloaded and placed in the appropriate folder by Document Factory. When the report is opened, Microsoft Word will have no problem retrieving the image from the location specified in the document.

However, when the report (xml file) is distributed (typically without the images' files) and opened in another computer, Microsoft Word will attempt to retrieve the images from the specified locations but will be unable to locate the files. Consequently, the images are not shown.
Incident #2536790