Microsoft Office Forums A macro needed to crop to fit all images at once

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-13-2015, 10:39 AM
shaivya1998 shaivya1998 is offline A macro needed to crop to fit all images at once Windows 8 A macro needed to crop to fit all images at once Office 2013
Novice
A macro needed to crop to fit all images at once
 
Join Date: Aug 2015
Posts: 5
shaivya1998 is on a distinguished road
Post A macro needed to crop to fit all images at once

Anyone who is good with macros can create a macro for me in PowerPoint 2013 which will crop to fit all images on the slide at once. Please mention the steps of doing that if possible (even the naming part of macros).
Reply With Quote
  #2  
Old 08-14-2015, 02:36 AM
JohnWilson JohnWilson is online now A macro needed to crop to fit all images at once Windows 7 64bit A macro needed to crop to fit all images at once Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,791
JohnWilson will become famous soon enoughJohnWilson will become famous soon enough
Default

Explain a little more what you need.

Are the pictures in PICTURE Placeholders?
Just one slide or all slides need to be cropped?
Anything other useful info?
__________________
Microsoft PowerPoint MVP
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
  #3  
Old 08-14-2015, 02:45 AM
shaivya1998 shaivya1998 is offline A macro needed to crop to fit all images at once Windows 8 A macro needed to crop to fit all images at once Office 2013
Novice
A macro needed to crop to fit all images at once
 
Join Date: Aug 2015
Posts: 5
shaivya1998 is on a distinguished road
Post

Quote:
Originally Posted by JohnWilson View Post
Explain a little more what you need.

Are the pictures in PICTURE Placeholders?
Just one slide or all slides need to be cropped?
Anything other useful info?
I am using a picture layout to rearrange different logos of companies. I want to crop to fit them in only one slide.
Reply With Quote
  #4  
Old 08-14-2015, 03:10 AM
JohnWilson JohnWilson is online now A macro needed to crop to fit all images at once Windows 7 64bit A macro needed to crop to fit all images at once Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,791
JohnWilson will become famous soon enoughJohnWilson will become famous soon enough
Default

Not sure I really understand but maybe

Code:
Sub cropFit()
Dim osld As Slide
Dim oshp As Shape
On Error Resume Next
Set osld = ActiveWindow.View.Slide
If Not osld Is Nothing Then
For Each oshp In osld.Shapes
If oshp.Type = msoPlaceholder Then
If oshp.PlaceholderFormat.Type = ppPlaceholderPicture Then
oshp.Select
CommandBars.ExecuteMso ("PictureFitCrop")
End If 'picture placeholder
End If 'placehoder
Next oshp
End If ' Slide selected
End Sub
__________________
Microsoft PowerPoint MVP
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
  #5  
Old 08-14-2015, 03:27 AM
shaivya1998 shaivya1998 is offline A macro needed to crop to fit all images at once Windows 8 A macro needed to crop to fit all images at once Office 2013
Novice
A macro needed to crop to fit all images at once
 
Join Date: Aug 2015
Posts: 5
shaivya1998 is on a distinguished road
Default

Quote:
Originally Posted by JohnWilson View Post
Not sure I really understand but maybe

Code:
Sub cropFit()
Dim osld As Slide
Dim oshp As Shape
On Error Resume Next
Set osld = ActiveWindow.View.Slide
If Not osld Is Nothing Then
For Each oshp In osld.Shapes
If oshp.Type = msoPlaceholder Then
If oshp.PlaceholderFormat.Type = ppPlaceholderPicture Then
oshp.Select
CommandBars.ExecuteMso ("PictureFitCrop")
End If 'picture placeholder
End If 'placehoder
Next oshp
End If ' Slide selected
End Sub


It isn't working with picture layouts.
Reply With Quote
  #6  
Old 08-14-2015, 03:34 AM
JohnWilson JohnWilson is online now A macro needed to crop to fit all images at once Windows 7 64bit A macro needed to crop to fit all images at once Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,791
JohnWilson will become famous soon enoughJohnWilson will become famous soon enough
Default

It does but you are not explaining clearly exactly what you mean.

Maybe post a sample slide and explain what you want to happen to it.
__________________
Microsoft PowerPoint MVP
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
  #7  
Old 08-14-2015, 03:51 AM
shaivya1998 shaivya1998 is offline A macro needed to crop to fit all images at once Windows 8 A macro needed to crop to fit all images at once Office 2013
Novice
A macro needed to crop to fit all images at once
 
Join Date: Aug 2015
Posts: 5
shaivya1998 is on a distinguished road
Default

Quote:
Originally Posted by JohnWilson View Post
It does but you are not explaining clearly exactly what you mean.

Maybe post a sample slide and explain what you want to happen to it.
https://goo.gl/photos/57Lt6gbgkiY6AGiy7
Reply With Quote
  #8  
Old 08-14-2015, 07:34 AM
JohnWilson JohnWilson is online now A macro needed to crop to fit all images at once Windows 7 64bit A macro needed to crop to fit all images at once Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,791
JohnWilson will become famous soon enoughJohnWilson will become famous soon enough
Default

A photo isn't really a sample of the slide but at least I can see you mean a Smart Art layout.

Make sure the Smart Art is selected and try this - USE A COPY!

Code:
Sub chexSA()
Dim osa As SmartArt
Dim osld As Slide
On Error Resume Next
Dim i As Integer
Set osa = ActiveWindow.Selection.ShapeRange(1).SmartArt
For i = 1 To osa.AllNodes.Count
osa.AllNodes(i).Shapes(2).Select
CommandBars.ExecuteMso ("PictureFitCrop")
Next
End Sub
__________________
Microsoft PowerPoint MVP
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
  #9  
Old 08-14-2015, 08:11 AM
shaivya1998 shaivya1998 is offline A macro needed to crop to fit all images at once Windows 8 A macro needed to crop to fit all images at once Office 2013
Novice
A macro needed to crop to fit all images at once
 
Join Date: Aug 2015
Posts: 5
shaivya1998 is on a distinguished road
Default

Quote:
Originally Posted by JohnWilson View Post
A photo isn't really a sample of the slide but at least I can see you mean a Smart Art layout.

Make sure the Smart Art is selected and try this - USE A COPY!

Code:
Sub chexSA()
Dim osa As SmartArt
Dim osld As Slide
On Error Resume Next
Dim i As Integer
Set osa = ActiveWindow.Selection.ShapeRange(1).SmartArt
For i = 1 To osa.AllNodes.Count
osa.AllNodes(i).Shapes(2).Select
CommandBars.ExecuteMso ("PictureFitCrop")
Next
End Sub
Thanks man it worked. Really thanks....
Reply With Quote
Reply

Tags
crop to fit, macros

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
A macro needed to crop to fit all images at once Help Creating Macro to Crop/Resize Images ineedmacrohelp Word VBA 1 08-06-2015 06:46 AM
A macro needed to crop to fit all images at once ***help*** macro needed PokerBob Excel 8 03-18-2015 02:57 PM
Macro Needed to bold specific lines and Macro to turn into CSV anewteacher Word VBA 1 05-28-2014 03:59 PM
Check box macro help needed Aflac Word 4 03-24-2012 07:11 PM
A macro needed to crop to fit all images at once Callout macro needed - Help please Peter Denly Word VBA 19 07-20-2011 03:30 AM


All times are GMT -7. The time now is 07:59 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft