Hi All.
I'm looking for a way to automate compressing pictures in powerpoint
I found the following code workaround, but it stops
atI that once the dialog is open, the vba stops. Possibly a Modal issue?![]()
CommandBars.ExecuteMso ("PicturesCompress")
But I don't think that the "SendKeys" lines are executing and I can't access the VBE to check at this point.
![]()
Private Sub compressor() Dim opic As Shape Set opic = ActiveWindow.Selection.ShapeRange(1) If opic.Type = msoPicture Then CommandBars.ExecuteMso ("PicturesCompress") SendKeys "%{e}" 'chooses Email SendKeys "{ENTER}" End If If opic.Type = msoPlaceholder Then If opic.PlaceholderFormat.ContainedType = msoPicture Then CommandBars.ExecuteMso ("PicturesCompress") SendKeys "%{e}" SendKeys "{ENTER}" End If End If End Sub
Option 1, I would like to bypass having the user need to interact, especially as this will be for a LOT of pictures.
Option 2, If the user has to click manually would like a method to check the size of a photo before compressing it.
Option 3, I am open to suggestions.
Bookmarks