LittleOne
LittleOne

Reputation: 131

Powerpoint Interop API access multiple slide masters inside slide master view

I have powerpoint presentation with multiple master slides.I want to access current active powerpoint presentation slide master in master view using InterOp API and VB.net. When I tried to access active slide master it always select the first slide master instead of active master slide.I tried it with slides and I could access current slide.But in slideMaster view I couldn't find way to access specified slide master.

If(ActiveWindow.ActivePane.ViewType = PowerPoint.PpViewType.ppViewSlideMaster) Then 'condition 

ActivePresentation.Slides(2) 'this way I can access specified slide.
ActivePresentation.SlideMaster 

Upvotes: 0

Views: 1553

Answers (2)

Steve Rindsberg
Steve Rindsberg

Reputation: 1

Debug.Print ActiveWindow.View.Slide.Name
Debug.Print ActiveWindow.View.Slide.Design.Name

In Slide Master view, PPT 2010 (and probably 2007 too), the first line gives you the name of the currently selected Layout or Master, the second gives you the name of the Design that underlies the master.

In a multi-master presentation, you look at the Designs collection to arrive at the masters.

Other versions of PPT work differently. This explains more about designs, layouts, masters, lions, tigers and bears, o my:

Slides, Masters, Designs, Layouts ... how do they all fit together?

Upvotes: 0

Paul B.
Paul B.

Reputation: 2524

If by "active slide master" you mean the slide master used by the currently selected slide you can access it via

ActiveWindow.Selection.SlideRange(1).Design.SlideMaster

Or likewise for the master of the first slide in the presentation

ActivePresentation.Slides(1).Design.SlideMaster

Or in slide master view

If ActiveWindow.ActivePane.ViewType = ppViewMasterThumbnails Or _
    ActiveWindow.ActivePane.ViewType = ppViewSlideMaster Then

    ActiveWindow.View.Slide...
End If

Upvotes: 2

Related Questions