Deleted JPEGs remain in template file, increasing file size

A

albyw

Hi all,

I’ve got an image and file-size problem. I use a Word 2002 template with a
lot of custom VBA and styles. While changing the template’s look and feel, at
one point I had a 700kb jpeg as a background for the cover design. I’ve since
deleted that jpeg and now use embedded EPS files for the front page graphics.

However, even though the jpeg has been deleted and there are no tracked
changes in the template, the file size of documents saved out of this
template is still about 4.5MB. When I saved a copy of the template as an HTML
file and examined the _files folder, it contained two copies of the 700kb
deleted jpeg file. So even though the image has been deleted and isn't
tracked, there are still two copies of it retained in the file. Is there any
way to remove this information from my file? It makes a big difference to the
number of emails required to be sent with documents attached.

Thanks in advance,
Adam
Sydney, Australia
 
M

macropod

Hi albyw,

It may be that you had multiple copies of the image inserted, and some of them are outside the page margins.
Pressing Ctrl-A then Delete in the body of the template, followed by the same steps in the headers and footers should fix the
problem.

Alternatively, if you don't want to lose whatever default text etc you have in the template, and, apart from the EPS graphics you
referred to, these are the only pictures (and you're will to lose the EPS graphics and restore them afterwards), you could use a
macro like:
Sub ClearAllPictures()
Dim oSection As Section, shp As Shape, oHeadFoot As HeaderFooter
With ActiveDocument
For Each shp In .Shapes
If shp.Type = msoPicture Then shp.Delete
Next
For Each oSection In .Sections
For Each oHeadFoot In oSection.Footers
With oHeadFoot
If Not .LinkToPrevious Then
For Each shp In .Shapes
If shp.Type = msoPicture Then shp.Delete
Next
End If
End With
Next
For Each oHeadFoot In oSection.Headers
With oHeadFoot
If Not .LinkToPrevious Then
For Each shp In .Shapes
If shp.Type = msoPicture Then shp.Delete
Next
End If
End With
Next
Next
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top