RE: Need macro to set all pictures in document to a certain size by olimerge
olimerge
Wed Mar 21 04:01:02 CDT 2007
cheers for your help lene. i ended up cheating and using .width = 87 etc
until I found the right dimensions, but I see now I could have just used the
centrimetres to points command.
Thanks again
"Lene Fredborg" wrote:
> Below you will find a macro that resizes all pictures in the active document
> to the size you specified.
>
> NOTE: If your pictures are not in the text layer (wrapping style â??In line
> with textâ?? - set via Format > Picture > Layout tab) but floating (any other
> wrapping style), you must change the â??Dimâ?¦â?? line and the â??For eachâ?¦â?? line to
> the following:
>
> Dim oShape As Shape
> For Each oShape In ActiveDocument.Shapes
>
> The macro:
>
> Sub ResizePictures()
>
> Dim oShape As InlineShape
> For Each oShape In ActiveDocument.InlineShapes
> With oShape
> 'Change msoFalse to msoTrue to scale proportionally
> .LockAspectRatio = msoFalse
> .Width = CentimetersToPoints(2.81)
> .Height = CentimetersToPoints(4.5)
> End With
> Next oShape
> End Sub
>
> --
> Regards
> Lene Fredborg
> DocTools - Denmark
> www.thedoctools.com
> Document automation - add-ins, macros and templates for Microsoft Word
>
>
> "oli merge" wrote:
>
> > Hi,
> >
> > i need a macro to set all pics to a certain size (in this case 4.5cm high
> > and 2.81cm wide).
> >
> > I have tried resizing the pictures to the desired size manually first but
> > its no good because i cant find a prgram to do it that is free and doesnt
> > have limits on quality or amount of pictures in batch.
> >
> > I already have a macro to resize all pics to a percentage of the original
> > size, so if you just tell me how to set an absolute size I can adapt that.
> >
> > thanks