Quote:
Originally Posted by AllekieF
Modified the code a bit. Should work, but doesn't check for correct selection type.
|
It works perfectly

That's what I want
Thanks so much
I also googled and found this code, and also works perfectly
Code:
Sub AlignAndStretchImage()
' VBA macro to align an image in the middle and center of the slide
Dim shp As Shape
Set shp = ActiveWindow.Selection.ShapeRange(1)
' Set the shape's size to match the slide's size
shp.LockAspectRatio = msoFalse
shp.Width = ActivePresentation.PageSetup.SlideWidth
shp.Height = ActivePresentation.PageSetup.SlideHeight
' Set the shape's position to the center of the slide
shp.Left = (ActivePresentation.PageSetup.SlideWidth - shp.Width) / 2
shp.Top = (ActivePresentation.PageSetup.SlideHeight - shp.Height) / 2
End Sub
Best Regards