Re: Image Size in Bytes by Peter
Peter
Fri Jul 18 04:02:57 PDT 2008
' I had a go at a macro myself.
' got this far and am now stumped.
' All help appreciated.
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 18/07/2008
'
For Each s In ActiveDocument.Shapes
s.Select
' I can see its name, actually a number such as 1 2 3 etc.
' but not for shapes "In Line With Text"
MsgBox Selection.ShapeRange.Name
' I can see the type, but the only number I get is 13.
' I think 13 means msoPicture
MsgBox Selection.ShapeRange.Type
' I want to do this next, but it does not exist.
MsgBox Selection.ShapeRange.SizeInBytes
Next s
End Sub
'How can I
' (1) Select all shapes, whether they are In line, floating or in a
Canvas?
' (2) Find out what type they are such as Picture, JPG, GIF, BMP etc.
' (3) Find out its size in bytes.
'Thanks
'Peter
On 18 Jul, 09:58, xlf...@gmail.com wrote:
> Hello,
>
> I have a large Word file with about 300 images in it.
>
> I have visited MS and MVP pages any tried every trick in the book to
> reduce the size of it,but with not much luck.
>
> If I knew which images were bloating the most I could address those
> directly.
>
> Does anyone have a bit of quick and dirty code that will run through
> the doc and print a list of images and their size in bytes, and which
> page they are on.
>
> (I'm not a VBA techie, but I can follow the logic of simple code.)
>
> Thanks.
>
> Peter
> Cardiff
> Wales
> UK
> (Overcast sky, grey and a bit chilly. Its Summer in the UK!)