Powerpoint Macro doesnt work on Slideshow

Joined
Jul 19, 2018
Messages
1
Reaction score
0
Hi
Can anybody help me about this issue. I found a script to take snapshot from first page of my powerpoint. it works when I run the macro in normal view. but when i use the action button and click on it at the slideshow there is no action.
I expect it to take snapeshot from my presentaion view everytime i click the acton button on slide show.. but

this is the script (I do not have any programming knowledge)


Sub SaveCurrentSlideAsJpg()
Dim imagePath As String
Dim slideNum As Integer
imagePath = "C:\JPG\"
slideNum = ActiveWindow.Selection.SlideRange(1).SlideIndex

' first check if this already exists then delete it
If Dir(imagePath & ActivePresentation.Name & "_" & slideNum & ".jpg") <> "" Then
Kill imagePath & ActivePresentation.Name & "_" & slideNum & ".jpg"
End If

' now save the slide
ActivePresentation.Slides(slideNum).Export _
FileName:=imagePath & ActivePresentation.Name & "_" & slideNum & ".jpg", _
FilterName:="JPG"

End Sub
 
Back
Top