I know what the problem is, but I don't know how to fix it retroactively. A department has scanned images and inserted them into MS Word documents. The scans were at high resolution and full color. The users didn't know any better. I can fix the process to prevent further glut, but how do I fix the older documents? We are talking about 10,000+ documents so manually opening each document and compressing the images and reducing the colors will not work. I did that on one and reduced the file size from 41MB to 2MB. This one site currently comprises 20% of my farm storage. Any ideas?

  • 1
    I'm assuming you are on-prem because of your comment about farm storage. In that case, a custom solution (maybe console app?) using OpenXML might help. I don't think it can do image processing, but if you can find a C# solution to the image processing part, OpenXML can certainly be used to crack open the documents and get to the images' binary information. Jun 10, 2016 at 19:40
  • I would look into using PowerShell to automate the shrinking process. In SharePoint, make sure you check the libraries for workflows and versioning. Jun 10, 2016 at 19:48
  • No versions or Workflows. @DylanCristy, can you post an answer with steps? or resources?
    – Jammin4CO
    Jun 14, 2016 at 16:27
  • Here's a link to the OpenXML SDK. I''m not posting an answer because I don't know anything about the feasibility of doing the image processing you need in code, and without that, you don't have a solution. But you definitely can open Word docs, manipulate them, and save them back into SharePoint using OpenXML and the server object model. Jun 14, 2016 at 17:13
  • In general the steps would be - write code that: opens a word doc from the doc lib, finds the image binary data, passes that data to some other code to do the image processing and reduce the size, re-insert that into the word doc, and save it back into the doc lib. Jun 14, 2016 at 17:15

1 Answer 1


I dont think, if there is any tool or way to edit a word file. Your requirement is Open the Word document and compress the images and re-upload it.

If possible then i would create new documents with proper way. if not then download and edit them.

  • While this is the way to do one or a few files, as was mentioned in the post, it is not viable for such a large number of files. @Dylan Cristy 's comment is the closest so far, but has not been posted as an answer.
    – Jammin4CO
    Jun 14, 2016 at 16:30
  • 1
    there is no such solution available to do it. Again for custom solution, you mileage will vary as your requirement is open the file, compress the image and add the image into the document then upload into SharePoint. This is kind of utility which you are going to write.
    – Waqas Sarwar MVP
    Jun 14, 2016 at 16:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.