owen_1987
08-09-2011, 04:20 AM
Hi all,
I'm new here and just wanted to ask what I hope is a straight forward question. When refering to an Enhanced Metafile object, what is the correct name for it?
The context of the question is that I am writing a macro to resize and centralise all of the Enhanced Metafile objects in my presentation. But at the moment the code is refering to "picture" (txt in red) which is resizing and centralising every picture on the slides. All of the pictures are jpeg's which is why I am trying to distinguish from the Enhanced Metafiles.
My code:
Sub picturesizer()
Dim i As Integer
Dim osld As Slide
Dim opic As ShapeRange
For Each osld In ActivePresentation.Slides
For i = 1 To osld.Shapes.Count
If osld.Shapes(i).Type = msoPicture Then
Set opic = osld.Shapes.Range(i)
opic.LockAspectRatio = True
opic.Height = 320 'change to suit
opic.Align msoAlignMiddles, msoTrue
opic.Align msoAlignCenters, msoTrue
End If
Next i
Next osld
End Sub
Hope that makes sense and thanks in advance for any help/ advice
I'm new here and just wanted to ask what I hope is a straight forward question. When refering to an Enhanced Metafile object, what is the correct name for it?
The context of the question is that I am writing a macro to resize and centralise all of the Enhanced Metafile objects in my presentation. But at the moment the code is refering to "picture" (txt in red) which is resizing and centralising every picture on the slides. All of the pictures are jpeg's which is why I am trying to distinguish from the Enhanced Metafiles.
My code:
Sub picturesizer()
Dim i As Integer
Dim osld As Slide
Dim opic As ShapeRange
For Each osld In ActivePresentation.Slides
For i = 1 To osld.Shapes.Count
If osld.Shapes(i).Type = msoPicture Then
Set opic = osld.Shapes.Range(i)
opic.LockAspectRatio = True
opic.Height = 320 'change to suit
opic.Align msoAlignMiddles, msoTrue
opic.Align msoAlignCenters, msoTrue
End If
Next i
Next osld
End Sub
Hope that makes sense and thanks in advance for any help/ advice