Any VBA code to align an image from PowerPoint?
1 answer
Microsoft stores complex vector objects in WMF or EMF formats and must be converted to native MSO drawing objects (vectors) to edit them. The process for this is to ungroup them, and this code will do that for your entire presentation:
Option Explicit
' ===================================================================
' Purpose : Loop through each shape of each slide in a presentation
' and ungroup and WMF files, thereby converting them to
' MSO drawing objects that can be edited.
' Author : Jamie at YOUpresent Ltd. http://youpresent.co.uk/
' ===================================================================
Sub ConvertAllMetafilePicturestoGroups()
Dim oSld As Slide
Dim oShp As Shape
For Each oSld In ActivePresentation.Slides
For Each oShp In oSld.Shapes
On Error Resume Next ' In case picture is a bitmap and not a WMF vector
If oShp.Type = msoPicture Then oShp.Ungroup
On Error GoTo 0
Next
Next
' Clean up
Set oShp = Nothing: Set oSld = Nothing
End Sub
You can ungroup a second time if you need / need.
+2
a source to share

