Question

In PowerPoint, in "normal" view, the window is split into two panes, with a pane showing slide thumbnails on the left, and a pane showing the current slide on the right. You can select more than one slide in the left-hand panel, which is useful if you want to copy, move or delete slides.

To tell which slide(s) are currently selected in the left-hand panel, you can use ActiveWindow.Selection.SlideRange. However, if you click between slides in the left-hand (thumbnail) panel, you end up with an insertion point, and:

  • ActiveWindow.Selection.Type is zero (ppSelectionNone).
  • ActiveWindow.Selection.SlideRange gives an error.

I have a question in two halves:

  1. How can I detect this situation? (Presumably there are other cases where the selection type is "none").
  2. How can I tell where the insertion point is, so that I can insert new slides at that point?

Either VBA or VSTO code would be fine :-)

Was it helpful?

Solution

I just found this: http://skp.mvps.org/pptxp020.htm

Summary: switch to ppViewSlide view and then back again, and PowerPoint will select the slide before the insertion point (or the first slide, if the IP is at the start).

I'd still be interested in a better way that avoids the screen flicker inherent in this approach (and ideally does not change the selection).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top