I think I'm almost there
When pasting in a picture, it does not fill the placeholder, and it centers horizonatally and vertically
I'd like to be able to use a macro to resize and reposition the picture so as to fill the original (i.e. Master's) place holder (subject to aspect ratio) and to position the picture to the top of the placeholder
The part I'm having a lot of problems with is figuring out how to get the Master slide layout for that placeholder on that type of slide
It seems that pasting in the picture re-sizes the placeholder height and width and the originals are lost
[vba]
Option Explicit
Sub FixPictures()
Dim oPres As Presentation
Dim oSlide As Slide
Dim oPlaceHolder As Shape
Dim i As Long
Set oPres = ActivePresentation
Set oSlide = oPres.Slides(2) ' fixed for testing
For Each oPlaceHolder In oSlide.Shapes
If oPlaceHolder.Type = msoPlaceholder Then
If oPlaceHolder.PlaceholderFormat.ContainedType = msoPicture Then
For i = 1 To oSlide.Master.CustomLayouts.Count
If oSlide.Master.CustomLayouts(i).MatchingName = oSlide.CustomLayout.MatchingName Then
'position picture to top of placeholder
'maintain aspect ration
'make picture width = placeholder width
'if picture height > placeholder height then
' make picture height = placeholder height
' center the picture
'endif
MsgBox oSlide.CustomLayout.MatchingName
Stop
End If
Next
End If
End If
Next
End Sub
[/vba]
Help please
Paul