vba ppt slide value

L

Lance Hoffmeyer

Hey all,

Is there an absolute value (progid?) for each slide that will not change regardless
of whether a slide is added or dropped? I am running some VBA scripts that work based
on slide number but slides could be added or dropped each QTR and thus the slide number
for a particular slide could change.

If there is an absolute number for a slide that will not change

1) How do I determine this number via VBA?
2) How do I access this in a script?

instead of this how would I access the absolute value of the slide number?
Set oPPTShape = oPPTFile.Slides(33).Shapes("Object 2")

Thanks in advance,

Lance
 
S

Shyam Pillai

Lance,
The SlideID is unique, it does not change.
MsgBox "The Slide ID of the current slide is:" & _
ActiveWindow.View.Slide.SlideID

To locate a slide using the slide you would use the FindByID method.
Set oSld = ActivePresentation.Slides.FindBySlideID(256)


--
Regards,
Shyam Pillai

Animation Carbon: Copy/Paste/Share animation libraries.
www.animationcarbon.com
 
A

Austin Myers

If there is an absolute number for a slide that will not change

Not really Lance. Thats why I always write a number or descrition to a
slide tag. I know that isn't going to be changed.

Austin Myers
MS PowerPoint MVP Team

Provider of PFCPro, PFCMedia and PFCExpress
www.playsforcertain.com
 
B

Bill Dilworth

Deleting a slide is not the problem.

However, since the ID number is only semi-unique, it is possible to run into
an instance where you paste a slide with ID 2048 (from another machine, for
example) into a presentation that already contains a slide ID 2048 (from
your machine). I don't know how PowerPoint resolves this issue, and don't
entirely trust it to do what I want it to in those cases. Your way works.

--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
 
S

Shyam Pillai

Austin,
Steve filled in with the details. It's a handy property which is mostly
reliable. There is a similar property ID for shapes which was introduced in
PPT 2002.


--
Regards,
Shyam Pillai

Animation Carbon: Copy/Paste/Share animation libraries.
www.animationcarbon.com
 

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