Use a Salesforce static resource to store content you reuse across documents, such as a logo, a text block or HTML. You upload the file once in Setup, then reference it in your template with merge syntax.

Create the static resource

  1. Log in to Salesforce and open Setup.

  2. In the Quick Find box, enter Static Resources, then click Static Resources under Custom Code.

  3. Click New. The new static resource form opens.

  4. In Name, enter a name for the resource, for example Staticcontent.

    New static resource form with Staticcontent entered in the Name field

  5. In File, click Choose File and select your file, for example a .txt file or an image, then click Save. The detail page of the static resource opens.

  6. Copy the Name of the static resource (in this example, Staticcontent).

Add the static resource to a template

  1. In your template, add the merge syntax for the type of content. Replace Staticcontent with the name you copied.

    ContentSyntax
    Text{{StaticResource.Staticcontent}}
    Image{{Image:StaticResource.Staticcontent}}
    HTML{{HTML:StaticResource.Staticcontent}}

    Word template with static resource merge syntax for text, image and HTML content

  2. Go back to the object record and generate the document to check the output.

    Text file output:

    Generated document showing the text from the static resource file

    Image output:

    Generated document showing the image from the static resource

Related: Image parameter · HTML (Rich Text Area) parameter