|
-
Jul 30th, 2009, 07:29 PM
#1
Thread Starter
New Member
Looking up Custom Shapes
Hey everyone,
I have a program that create shapes with tagged properties in either Excel and PowerPoint. I have an issue where I need to loop through these "tagged" shapes to add/extract information to them.
Unfortunately there are many other standard Shapes or the same slide/sheet that I don't care to loop through since they wouldn't have the tags to begin with. Right now I am currently using something to the effect of:
Code:
Sub GetShapeNames()
For Each Shape In ActivePresentation.Slides(1).Shapes
If Shape.Tag("Type") = "Special" Then Debug.Print Shape.Name
Next Shape
End Sub
'where i would like to use something like:
Sub GetTaggedEventNames()
Dim tgdEvt As New TaggedEvent
For Each tgdEvt In ActivePresentation.Slides(1).Shapes
Debug.Print tgdEvt.Name
Next tgdEvt
End Sub
I know how to make custom classes/objects, but not how to say my custom Object is really a PowerPoint/Excel Shape. And then after that, is it possible to create a custom ScheduleEvents property of the ActivePresentation.Slides object, similar to how there is a Slides property?
Any ideas on how this could work? Or better yet, if you know of a better way to limit the amount of objects it needs to loop through (assuming it has to loop through all tagged Shapes on a slide/sheet to complete the tags update)?
Thanks! 
Kyle
-
Jul 30th, 2009, 09:13 PM
#2
Re: Looking up Custom Shapes
you could try grouping the custom shapes
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|