0
votes

Application is a C# based VSTO-AddIn for PowerPoint.

Each SlideLayout in powerpoint has a type. Is there way to get the type in an VSTO-AddIn? Up to now I just know how to get it from the SlideLayout.xml

I'm using the SlideSelectionChanged-event. The passed SlideRange has the attribute Layout but it throws a TargetInvocationException. I would like to get the layout of a SlideLayout-slide.

The important point is that the application is in SlideMaster-mode - not the common editing of content-slides.

private void Application_SlideSelectionChanged(SlideRange _slide)
{
    _slide.Layout ... ?
}
1
Could you give a bit more detail about how to reproduce your situation (make sure we're looking at the same thing)? You're in the Slide Master view and switching slides in that view? Are you sure a Slide Master has a SlideLayout? From the object model Help I got the impression Slide Master uses CustomLayout...? - Cindy Meister
Yes, I'm switiching slides in the slidemaster. There is the first slide - the slidemaster - and the children - called slidelayouts. They can be custom or having a certain type. In OpenXML the types are named like "title", "obj", "secHead", etc.... it is the differentation between title-slide, one-column-slide, two-column-slide, etc. - xforfun
If you are in the slide master view then you are dealing with the custom layouts. The slide won’t have any layouts set since it is a layout. The slide will have a name which matches the xml attribute you have mentioned. - Shyam Pillai
Okay. Thanks. So there is no numeric type? Interesting ... - xforfun
Because there's no fixed collection of layouts ... ie, the user can delete them or add new ones ... it wouldn't make sense for them to have numeric types. - Steve Rindsberg

1 Answers

0
votes

I had the same question, finally I found the following property that returned the ViewType:

Globals.ThisAddIn.Application.Windows[1].ActivePane.ViewType