Thursday, March 18, 2010

Embed linked images in Word

The problem: doxygen (a great tool for generating documentation for C++ source code) can produce RTF files as output. The images that are generated (class diagrams etc) are included as links in the document. As a result, when you copy-paste the content from the document or move the image files, the images disappear.

The solution: Open the RTF, select an image, and press Ctrl-Shift-F9. That's it. Doing the same via the scenic route: Choose Edit->Links, select all files, click "Break Links".

Caution: Don't try to be smart and select all before you press Ctrl-Shift-F9 because this will destroy automatically maintained text such as figure numbers or the table of contents.