PowerPoint Help needed with VB

Joined
Nov 27, 2018
Messages
1
Reaction score
0
I dont know why, but this piece of code doesnt seem to work.. Any help???


Private Sub CommandButton1_click()
If Slide1.m.Text = g Then
ActivePresentation.SlideShowWindow.View.GotoSlide 3

ElseIf Slide1.m.Text = h Then
ActivePresentation.SlideShowWindow.View.GotoSlide 4

Else
ActivePresentation.SlideShowWindow.View.GotoSlide 1

End If
End Sub


anyone help?
 
Well I see a couple things wrong with your code. First of all, what is the Slide1 object type? and what is the m property of that object, what is it's type? And then you don't have g defined within that Sub so it will throw a variable not defined error. Same thing goes for h, are you meaning to enclose that in quotes to compare them as strings?
 
Back
Top