PDA

View Full Version : Solved: Selected slides in slide sorter view



Paul_Hossler
06-15-2010, 02:07 PM
In PP2007 slide sorter view, how can I tell which slides are selected?

Example: if I have 10 slides in the PPTX, and using slide sorter view, I select 1,3,5, and 7 by control-click, how can VBA find out that it's only those 4 that are selected?

Paul

John Wilson
06-16-2010, 06:14 AM
Something based on
Sub countsel()
Dim i As Integer
Dim strSel As String
For i = 1 To ActiveWindow.Selection.SlideRange.Count
strSel = strSel & CStr(ActiveWindow.Selection.SlideRange(i).SlideIndex) & vbCrLf
Next
MsgBox "Selected Slides" & vbCrLf & strSel
End Sub

Paul_Hossler
06-16-2010, 06:52 AM
ActiveWindow.Selection.SlideRange.Count


Thanks John. That works for me, but ....

I'd think there's some risk assuming that the Selection is one or more Slide objects

How can I test the Selection type to verify that Slide object(s) are selected, and not a Textbox or something?

Paul

John Wilson
06-16-2010, 07:14 AM
If ActiveWindow.Selection.Type <> ppSelectionSlides Then
MsgBox "No slides selected"
Exit Sub
End If

Paul_Hossler
06-16-2010, 09:57 AM
:doh: Now that I see it, it's obvious

I'll have to come up with harder questions :thumb

In case you're interested, your help goes into a Tags maintenance macro so that I can tag slides to work witn other macros (not started yet) to hide / unhide slide, create custom shows, etc.

Thanks again

Paul

Vivian66
06-21-2010, 02:27 AM
Thanks for your wisdom help.:thumb

Something based on
Sub countsel()
Dim i As Integer
Dim strSel As String
For i = 1 To ActiveWindow.Selection.SlideRange.Count
strSel = strSel & CStr(ActiveWindow.Selection.SlideRange(i).SlideIndex) & vbCrLf
Next
MsgBox "Selected Slides" & vbCrLf & strSel
End Sub