|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How can I make VBA to "crop to fit" all pictures to picture placeholders across all slides at once?
Hi all. I'm making an awesome game for my students but need some help setting up my slides so they can see all the pictures. My problem is that PowerPoint 2016 defaults all pictures inserted in picture placeholders to "crop to fill" so it cuts off too much of most of the pictures. But for this game to work, I need every picture to fit in each picture placeholder (crop to fit). Can anyone help me make a macro that crops-to-fit all pictures at once? And all of the pictures will be in picture placeholders. (Every game I make has over 60 slides and about 10 pictures per slide, so that's a lot of manual clicking I've tried regular content placeholders. They won't work for the game because they only insert pictures vertically, but in the game I need to rotate all the pictures different angles) |
#2
|
|||
|
|||
Not sure why you think content placeholders cannot be rotated.
There is nothing in the Object Model to set the crop type but it is possible by calling executeMso (essentially having code click the button) Try this Code:
Sub fixCrop() Dim osld As Slide Dim oshp As Shape For Each osld In ActivePresentation.Slides For Each oshp In osld.Shapes If oshp.Type = msoPlaceholder Then If oshp.PlaceholderFormat.Type = ppPlaceholderPicture Then ActiveWindow.View.GotoSlide (osld.SlideIndex) oshp.Select CommandBars.ExecuteMso ("PictureFitCrop") End If End If Next Next End Sub |
#3
|
|||
|
|||
The code works well! My hands are saved... now my students hands will fall off from these games
Thanks a million for the macro. It works like a charm.
You just added hours...no, actually days onto my life. And apologies about the content placeholder confusion. I definitely can rotate the content placeholder in the slide master. The only problem is that when you insert a picture into a regular content placeholder that's been rotated, it always puts the picture up and down. It doesn't rotate it with the placeholder for some odd reason. That's not the case with the picture placeholder. The pic keeps the orientation of the placeholder. And now with your nifty macro, all my pictures can be rotated and cropped to fit. Truly grateful |
#4
|
|||
|
|||
Glad it helped. Still don't understand the rotation problem with content placeholders though!
|
Tags |
crop to fit, placeholders, vba |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using "insert other placeholders" *Ask, *Fill In, etc | nfotx | Mail Merge | 1 | 07-06-2015 02:04 PM |
"Insert Picture\Link to File..." embeds picture | sinz54 | Drawing and Graphics | 1 | 09-29-2013 06:31 PM |
how to make the "Picture Tools" ribbon permanent? | skipstocks | Word | 1 | 07-19-2013 06:51 AM |
"format picture" - arrows show as no line atop picture | marbeth | Word | 3 | 07-08-2011 02:16 PM |
Option "Show picture placeholders" only works for inline pictures?? Fix? | MattM | Word | 2 | 06-15-2011 06:33 AM |