Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find Shape Name. PPT VBA 2000

Status
Not open for further replies.

tgmoon

Technical User
Jan 31, 2001
54
GB
Hi.

I'm using the following bit of code to act according to what shape name is currently selected.

Sub MySub()
Dim sh As Shape
On Error Resume Next
Set sh = ActiveWindow.Selection.ShapeRange(1)
If Not sh Is Nothing Then
If sh.Name = "Picture" Then
Call MyPictureCode(myVarients)
Exit Sub
End If
End If
Call NoPictureCode(myVarients)
End Sub.

Where i'm a bit lost at the moment, is that i'd like the code to hunt out for a shape named "Picture" on a slide on it's own, with out the user having to pre-select it, and act according to wheather the picture is there or do something else if not.

Regards

Thom

 
Code:
For each var in  NameOfYourPresenation.Slides(2).shapes

if var.name  = "picture" then 
   do some stuff
end if 

next

Chance,

Filmmaker, taken gentleman and He tan e epi tas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top