Vba to resize all images in slideshwo ?

M

MoiMeme

Hi,

how can I resize all images in a slideset ( have 100 of them to resize and
reposition).

Manually very fastidious, so looking for somevba code to automate it !

TIA all
 
G

Guest

This should do it. Obviously you will need to change the size settings
(.width & .height) to suit and also the position (.top & .left)

'code starts
Sub picsize()

Dim oSld As Slide
Dim oShp As Shape

For Each oSld In ActivePresentation.Slides
For Each oShp In oSld.Shapes
If oShp.Type = msoPicture Then
With oShp
..Width = 100
..Height = 100
..Top = 100
..Left = 100
End With
End If
Next oShp
Next oSld
End Sub
'code ends
--
 
M

MoiMeme

Many thanks !
Will try it illico !

John Wilson said:
This should do it. Obviously you will need to change the size settings
(.width & .height) to suit and also the position (.top & .left)

'code starts
Sub picsize()

Dim oSld As Slide
Dim oShp As Shape

For Each oSld In ActivePresentation.Slides
For Each oShp In oSld.Shapes
If oShp.Type = msoPicture Then
With oShp
.Width = 100
.Height = 100
.Top = 100
.Left = 100
End With
End If
Next oShp
Next oSld
End Sub
'code ends
--
-----------------------------------------
Did that answer the question / help?
_____________________________
John Wilson
Microsoft Certified Office Specialist
 
M

MoiMeme

Hi John,

it worked fine.
Have modified the code a little so I can resize picture on first slide to
correct size-position, then run the code, to adjust all others to same
valudes as first slide ones.
Thanks a lot !!!

Phil
 
G

Guest

Glad to be of help, reading the size and position af a sample pic sounds like
a good move!

_____________________________
John Wilson
Microsoft Certified Office Specialist
 
M

MoiMeme

Thanks.
Have tested and it works fine

John Wilson said:
Glad to be of help, reading the size and position af a sample pic sounds
like
a good move!

_____________________________
John Wilson
Microsoft Certified Office Specialist
 

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