Article ID: 163194
Article Last Modified on 10/11/2006
Sub GetCurrentSlideNumber()
Dim lCurrentView As Long
' Get the current view type.
lCurrentView = ActiveWindow.ViewType
' Make sure that PowerPoint is in Slide view.
' ActiveWindow.Selection.SlideRange.SlideNumber produces an error if
' you are using any other view.
If lCurrentView = ppViewSlide Then
' Display the slide number.
MsgBox "You are on slide: " & _
ActiveWindow.Selection.SlideRange.SlideNumber, vbInformation
Else
' PowerPoint is not in slide view.
MsgBox "You must be in slide view to run this macro.", _
vbInformation
End If
End Sub
176476 OFF: Office Assistant Not Answering Visual Basic Questions
163435 VBA: Programming Resources for Visual Basic for Applications
Additional query words: 8.00 ppt8 vba vbe macppt mac_ppt ppt98 powerpt
Keywords: kbcode kbdtacode kbhowto kbmacro kbprogramming KB163194