How to merge an image in the output file of a generated document.
Appending “__image” at the end of the tag
Locate the field in the object that contains a record ID with an image extension. For example: 015i00000000w3N.gif. In the document, reference this field “__image” appended to the end of the tag.For example, referencing the tag <<Opportunity_Image_Formula>> will bring in the value of the field (the text "015i00000000w3N.gif"), whereas the tag <<Opportunity_Image_Formula__image>> will pull in the image referenced the field.Note: This does not necessarily have to be a record ID of the Document. This can also be an image URL.
Rich text field
Rich text fields are fields within an object that allow for formatted text, links and images. When using a rich text field, it is possible to use either text only or image only (it is not possible to combine the two in a single rich text field). The document will pull in whatever format is first in the field. For example, if text is the first thing in the field, only text will be pulled into the document.
Dynamic Image Replacement
An image can be dynamically replaced with the dimension of the image specified on the document. After placing an image in the document with the appropriate height and width, go to the selection pane in Word and select the image that is placed in the document. In the selection pane, input the tag with the “__image” (this is both for normal fields as well as rich text field).
These images need to be a publicly available (either from within Salesforce or a publicly available image URL).