none
Insert SharePoint's images into word document using open XML RRS feed

  • Question

  • Hi ,

    I want to insert some images in word document which are store in SharePoint using open XML but after inserting SharePoint images by ImagePart, word file is getting corrupt

    but if I am inserting local drive's images which are store in C,D drive, word file generating in well format, because local image we can take in filestream and we can set filemode.open  but if I try to open stream.read or stream.openBinary method for web images  then word file get corrupt without error.

    Please suggest me how to insert SharePoint or web images into word document using open XML.

    Monday, July 24, 2017 11:21 AM

All replies

  • Hi SumitRPareek,

    I try to find any documentation or example to insert images in word using OpenXML from web but did not get any useful information.

    I suggest you to first get the image from web and try to save it on your local disk in temporary.

    then from there you can try to add it in your document.

    then after you can delete the image in temp folder.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, July 25, 2017 9:00 AM
    Moderator