Access Shapes in Slide Master with VBA

P

Peter

I have a VBA script that updates a text box in a series of PowerPoint slides
as the slide show progresses. I can access a particular shape in each slide
with something like:

Set objSlide = SlideShowWindows(1).View.Slide
For Each objShape In objSlide.Shapes
Msgbox objShape.TextFrame.TextRange.Text
Next objShape

I would like to be able to access shapes in the slide master so the
following change to the first line should work:

Set objSlide = SlideShowWindows(1).View.Slide.Master

However, the this throws an error 13.

Can anyone advise as to how to access shapes in the slide master? Thanks.
 
S

Steve Rindsberg

I have a VBA script that updates a text box in a series of PowerPoint slides
as the slide show progresses. I can access a particular shape in each slide
with something like:

Set objSlide = SlideShowWindows(1).View.Slide
For Each objShape In objSlide.Shapes
Msgbox objShape.TextFrame.TextRange.Text
Next objShape

I would like to be able to access shapes in the slide master so the
following change to the first line should work:

Set objSlide = SlideShowWindows(1).View.Slide.Master

However, the this throws an error 13.

Can anyone advise as to how to access shapes in the slide master? Thanks.

..Master returns a Master object, not a Slide object, which is why you get the
Type Mismatch error.

If you declare objSlide as Object, it'll work.
 

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