3

I prepare documents in Word 2013. Each document runs into 100s of pages which includes over 50 pages of photographs in a table format. The table has three columns:

Sl.No...Photograph...Description

Each page will have about 3 photographs.

I re-size the original image into 320 x 480 pixels using ImageResizer (Microsoft powertoy). Doing so will reduce the size of the pic from 3 MB to about 100 KB.

When I copy + paste about 200 pics in the document, the file size would be anywhere from 10 MB to 50 MB. But if I then do cut + paste special + paste as JPEG for each pic, the file size is reduced to less than 5 MB.

Is there a way for me to copy a pic from a folder and directly paste as JPEG? Or even better, is there a way to batch edit all pics in a document so that all of them are pasted as jpeg at one go?

Any tip in this regard will be a huge help as I spend significant time and effort selecting each pic and paste special as jpeg.

Edit: I should mention that I am total novice when it comes to technical stuff. Can manage clicking a series of buttons etc but codes and other stuff are way over my head.

3 Answers 3

1

Have you tried the Compress pictures option under Picture tools - Format? In the dialog you can choose from different copression amounts, and there is a checkbox Apply only to this picture. Unchecking this, all of the images in your document will be compressed.
For images and more see this article ("Compress Pictures", almost on the bottom).

2
  • I have indeed tried that before and it doesn't seem to work. Even now, I tried on this file which is about 13 MB. Post the 'compress picture' execution (unselecting 'Apply only to this picture') the size is now 12.8 MB. But if I individually cut+paste special as JPEG, the entire file size reduces to about 1.7 MB. But it takes about an hour to do it pic by pic. A batch paste option or a feature where all images are infact compressed enough to reduce the file size significantly, would help Commented Dec 14, 2015 at 15:25
  • See my second answer ;)
    – nvi9
    Commented Dec 14, 2015 at 17:02
1

So... here is another, a little bit hacky solution:

  1. Save your documents in docx format (if you have them in this, go to step 2);
  2. Change the extension of the document to zip (you can leave docx before, like yourdocumentname.docx.zip); if you want, you can create a backup of your original document before doing anything;
  3. Extract the contents of the zip file to a folder (lets name it tmp) with WinRAR or anything else;
  4. In folder where you extracted the zip, look up a folder, named word;
  5. In the word folder, there is a media folder, there are the images of the document stored;
  6. Do the batch conversion for each png images with your tool you have;
  7. Check if you don't have the old png images in the folder (if you leave them there, the file size will increase instead of decrease, but I think it is unambiguous);
  8. If you have the converted jpg images in the media folder, go back to folder word, then to _rels;
  9. In the folder _rels, open the document.xml.rels file with notepad, or your favourite text editor (Sublime Text, Notepad++, etc.);
  10. In the file, there are different Relationship nodes, replace all of the "png" extensions to "jpg" in the Target attributes where needed (eg. Target="media/image4.png" -> Target="media/image4.jpg"; most of the editors have a Replace All option in their Find/Replace dialog);
  11. Save the edited file, go back to the root folder (tmp), select all, compress them back into a zip file (Important: don't include the tmp folder, just its content!, the zip file should look like the original - renamed from docx - zip file);
  12. Rename the new zip file to docx (eg. yourdocumentname.docx), and you are done! :)


There might be a less complicated way to do this, but this shuld work. If I had a little bit more time, I would create a tool for doing all this stuff programmatically, it could be useful for me too sometimes... Or there is a tool for this on the net, idk. (I haven't met anything like this yet.)

0

You could create a new macro-enabled template. On the Developer tab (you may need to customise your ribbon so this is visible - it's not displayed by default). Then click on the Visual Basic button. This will take you into the VBA editor. Insert a new Module and copy and paste the below macro code into the module. Save and close. Save your .dotm file into your Word Startup folder so it is accessible to all documents. With your document with photos in it the active open document, press Alt F8 and choose the macro (which you might rename from "test") from the list.

Macro code:

Sub test()
Dim shp As InlineShape
If ActiveDocument.InlineShapes.Count = 0 Then Exit Sub
For i = ActiveDocument.InlineShapes.Count To 1 Step -1
   Set shp = ActiveDocument.InlineShapes(i)
    If shp.Type = wdInlineShapePicture Then
        shp.Select
        Selection.Cut
        Selection.PasteSpecial Link:=False, DataType:=15, Placement:=wdInLine, _
        DisplayAsIcon:=False
    End If
Next
End Sub
2
  • it'd help if you expand the post including instructions on how to apply this macro
    – Sathyajith Bhat
    Commented Dec 21, 2015 at 8:18
  • You could create a new macro-enabled template. On the Developer tab (you may need to customise your ribbon so this is visible - it's not displayed by default), then click on the Visual Basic button. This will take you into the VBA editor. Insert a new Module and copy and paste the above code into the module. Save and close. Save your .dotm file into your Word Startup folder so it is accessible to all documents. With your document with photos in it the active open document, press ALT F8 and choose the macro (which you might rename from test) from the list.
    – Tanya
    Commented Dec 23, 2015 at 1:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .