Sub GetCurrentCursorPosForSlide()If ActiveWindow.ViewType = ppViewSlideSorter Then
'Current cursor position is not retreived when selection is between slides.
If ActiveWindow.Selection.Type = ppSelectionNone Then
'Switch to slide view and back.
ActiveWindow.ViewType = ppViewSlide
ActiveWindow.ViewType = ppViewSlideSorter
' This forces a selection based on the cursor position
' If cursor is between 2nd and 3rd slide it will select 2nd slide
' If cursor is before the 1st slide it will select the 1st slide
' If cursor is after the last slide it will select the last slide.
' If still nothing is selected then there are no slides in the presentation.
If ActiveWindow.Selection.Type = ppSelectionSlides Then
Debug.Print ActiveWindow.Selection.SlideRange.SlideIndex
Else
Debug.Print "No slides in the presentation."
End If
Else
' Get the slide reference and obtain the position. This is left as exercise.
End If
End If
End Sub |