Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / December 2007

Tip: Looking for answers? Try searching our database.

re: deleting objects

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bakalimbakalim - 24 Dec 2007 14:40 GMT
i tried but it deletes objects just a single slide
these objects are on every slide

"Line 9", "Picture 11", "Line 10", "Object 14"

and i want to delete them at once ? can i do it?

-----------------------------------------------------------------------------
That looks like code from the recorder? Not usually a good idea.

If it's at all possible never select shapes in vba and there's no need in
this case.

Is it "Picture 4" and "Object 5" on every slide?

Is so try this:

Sub zapem()
Dim osld As Slide
Dim oshp As Shape
Dim i As Integer
'cycle through all slides
For Each osld In ActivePresentation.Slides
'cycle through each shape in reverse order
For i = osld.Shapes.Count To 1 Step -1
Set oshp = osld.Shapes(i)
If oshp.Name = "Picture 4" Or oshp.Name = "Object 5" Then oshp.Delete
Next i
Next osld
End Sub

It's important to cycle through the shapes in reverse order because if you
go from 1 to the last shape and you eg delete Shapes(3) then Shapes(4)
becomes Shapes(3) and all the other shapes above will also change and
confuse
the code!
Signature

Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk

"bakalimbakalim" wrote:

> Sub Makro1()
>     ActiveWindow.Selection.SlideRange.Shapes("Picture 4").Select
>     ActiveWindow.Selection.ShapeRange.Delete
>     ActiveWindow.Selection.SlideRange.Shapes("Object 5").Select
>     ActiveWindow.Selection.ShapeRange.Delete
> End Sub
>
> this will remove picture 4 and object 5 in "a slide" but i want to do it
> in
> all slides how can i do it?
Bill Dilworth - 25 Dec 2007 05:05 GMT
Yes.

Just alter the text and iterations in the oshp.Name line of code to include
all the shape names you want to delete in the entire presentation.

Signature

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

>i tried but it deletes objects just a single slide
> these objects are on every slide
[quoted text clipped - 42 lines]
>> in
>> all slides how can i do it?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.