I have a need to programmatically add shapes to a selected custom layout (as selected by a user).
Backtracking for a second, if a user is in the normal view and has selected one or more slides, then it's possible to find out how many and address them as follows:
' Get the number of selected slides
' Get the slide index of the first selected slide
iSlideIndex = ActiveWindow.Selection.SlideRange(1).SlideIndex
and then add shapes to the first selected slide like this:
msoTextOrientationHorizontal, 0, 0, 10, 10
But when one tries to return the number of slides for a selected custom layout in the slide master view, a run-time error is returned:
Selection (unknown member) : Invalid request. SlideRange cannot be constructed from a Master.
It's possible to select one or more custom layouts in the slide master view via the standard UI so does this mean there is no way to get the selected custom layout object from the object model? The closest I've got is this:
But can't see how to identify which of the custom layouts the user has selected.