Forum Discussion

SaraBo's avatar
SaraBo
Brass Contributor
Sep 11, 2023

How to include a picture from a hyperlink (to Sharepoint doclib) in Word?

I want to create a Worddoc where a picture changes automatically once the pic in the Sharepoint doclib is replaced. (the Worddoc and the SP have accessrights for the same group of people on the same tenant on MS365 Business Standard)
I just tried the Insert> QuickParts >Field > Links & Refernces > Include Picture. I get this error.

Even when I use the URL of a pic on a (public) website it returns the same error. While in both cases the links on themselves work fine in a browser. So I guess there is something other than the link not working. Have you got any idea on how to fix this issue? And once it works, how to preserve the sizing on updating (if anything should be done for that)?

 



  • LeonPavesic's avatar
    LeonPavesic
    Silver Contributor

    Hi SaraBo,

    To insert a picture from a SharePoint document library hyperlink into a Word document and ensure it automatically updates when the source image changes, follow these steps:

    1. Get the SharePoint Document Library URL:

      • Make sure the image you want is in a SharePoint document library.
      • Copy the direct URL of the image file.
    2. Insert an Image Placeholder:

      • In your Word document, place your cursor where you want the image.
      • Go to the "Insert" tab and choose "Quick Parts" > "Field."
    3. Select the IncludePicture Field:

      • In the Field dialog box, look for "IncludePicture" in the list of field names.
    4. Set the Field Codes:

      • You'll see a placeholder in the "Field codes" box. Replace it with this code:
       
      INCLUDEPICTURE "URL"

      Replace "URL" with the direct link to your image in the SharePoint library.

    5. Preserve Image Sizing:

      • If you want to maintain the image's size, you can add the \d switch followed by the desired dimensions. For example, to set it to 300x200 twips, use:
       
      INCLUDEPICTURE "URL" \d 300x200

      Replace "URL" with your SharePoint image link.

    6. Update the Field:

      • To display the image, right-click on the field code and select "Update Field."
      • Your image will appear in the Word document.
    7. Save and Share:

      • Save the Word document where your team can access it, like SharePoint or OneDrive.

    Now, when you replace the source image in the SharePoint library, you can update the image in your Word document by right-clicking on it and choosing "Update Field."


    Please click Mark as Best Response & Like if my post helped you to solve your issue.
    This will help others to find the correct solution easily. It also closes the item.


    If the post was useful in other ways, please consider giving it Like.


    Kindest regards,


    Leon Pavesic

     

Resources