I'd like to do one of two things in PowerPoint 2007 on Windows.
The first is to change the default location for pasting in an image. When I paste in a graph I made with SAS, it pastes into the upper lefthand corner. Ideally, I'd like to change the default paste position. There don't seem to be any simple options for this but I thought maybe it was possible with VBA.
If it's not possible, then I'd like to write a VBA macro to step through each slide and change the image position.
I got a slide loop to work, thanks to this and other sites (the MsgBox is just a test):
Sub SlideLoop()
Dim osld As Slide
For Each osld In ActivePresentation.Slides
osld.Select
MsgBox "The slide index of the current slide is: " & _
ActiveWindow.View.Slide.SlideIndex
Next osld
End Sub
Beyond that, I haven't had much luck. I have seen code snippets that select all images on a slide and crop or resize them, and I found this bit on excelhelphq.com that is meant to position an image:
With ActiveWindow.Selection.ShapeRange
.Left = 50 'change the number for desired x position
.Top = 50 'change the number for desired y position
End With
But I'm not sure how to integrate it into the loop, and the online documentation for Powerpoint VBA is not particularly robust. Some code deals with the ShapeIndex but I wasn't sure how to work with that.
I should mention that I have only one image on a slide when I have an image (some slides do not have images at all, though).
This seems like the best time-saving approach, though I'm still manually pasting into PowerPoint in the first place.
I appreciate any help with this! I couldn't find anything that addressed this exact question.
Is VBA for PPT being phased out? It feels like Microsoft doesn't want people to be able to figure out how to use it based on their not-stellar online documentation.