PowerPoint VBA
PowerPoint VBA
Sub GotoLastViewed()
SlideShowWindows(1).View.GotoSlide (SlideShowWindows(1).View.LastSlideViewed
.SlideIndex)
End Sub
Sub GotoNext()
SlideShowWindows(1).View.GotoSlide GetCurrentSlide() + 1
End Sub
Sub GotoPrevious()
SlideShowWindows(1).View.GotoSlide GetCurrentSlide() - 1
End Sub
Sub GotoPage1()
SlideShowWindows(1).View.GotoSlide 1
End Sub
Sub GotoQuiz()
SlideShowWindows(1).View.GotoSlide 3
End Sub
Function GetCurrentSlide()
GetCurrentSlide = ActivePresentation.SlideShowWindow.View.Slide.SlideIndex
End Function
Sub correctAnswer()
Call GotoNext
waitTime = 0.5
Start = Timer
While Timer < Start + waitTime
DoEvents
Wend
SlideShowWindows(1).View.GotoSlide GetCurrentSlide() + 2
End Sub
Sub WrongAnswer()
SlideShowWindows(1).View.GotoSlide GetCurrentSlide() + 2
waitTime = 2
Start = Timer
While Timer < Start + waitTime
DoEvents
Wend
Call GotoLastViewed
End Sub
Public Sub ExportAsFixedFormat_CurrentSlide()
'ActivePresentation.ExportAsFixedFormat ActivePresentation.Path & "\Print
s Current Page.pdf", ppFixedFormatTypePDF, ppFixedFormatIntentScreen, msoCTrue,
ppPrintHandoutHorizontalFirst, ppPrintOutputBuildSlides, msoFalse, , ppPrintCurr
ent
MsgBox "complete", vbOKOnly
ActivePresentation.Close
End Sub