Macro help?

J

j

Trying to paste a screen print and build a macro to resize and reposition it.
The macro works, but only on one specific picture:
ActiveWindow.Selection.SlideRange.Shapes("Picture 6").Select. (Happens to be
"Picture 6" here.) How do I make it so that it will not look for a specific
picture, but will take the most recent pasted object?
 
B

Bill Dilworth

Since the most recently placed object will be the topmost layer (unless you
will change that after the pasting), you could use...

With ActivePresentation.Slides(1)
MsgBox .Shapes(.Shapes.Count).Name
End With


Where slide 1 is the current slide.


--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
yahoo2@ Please read the PowerPoint
yahoo. FAQ pages. They answer most
com of our questions.
www.pptfaq.com
..
..
 
H

Hans W. Hofmann

Since the most recently placed object will be the topmost layer (unless you
will change that after the pasting), you could use...
This is not quite correct.
It depends on selection you have befor you paste.
If there is no selection or shape selected then
With ActivePresentation.Slides(1)
MsgBox .Shapes(.Shapes.Count).Name
End With


Where slide 1 is the current slide.

If selection is a empty placeholder it will be integrated in
placeholder and have Zorder and Index of the placeholder

If you paste with code set an object pointer to shape
Set sh = ActiveWindow.View.Slide.Shapes.Paste
If user paste then you get the shape with
Set sh = ActiveWindow.Selection.ShapeRange(1)

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top