Command buttons

J

Jeff

I'm looking for some help with a bit of vb code.

I'm have a text box on a slide to allow users to type in the box. There is
also a command button that looks at the contents of the box and goes to the
appropriate slide. I have listed the vb code below

Private Sub CommandButton1_Click()

With Slide1
If UCase(TextBox1.Text) = "TEST" Then
MsgBox "You typed TEST. I should now go to slide 3"
With SlideShowWindows(1).View
.GotoSlide 3, msoTrue
End With
Else
MsgBox "You typed something else. I should now go to slide 2"
With SlideShowWindows(1).View
.GotoSlide 2, msoTrue
End With
End If
End With

End Sub


All works well until I exit PowerPoint. When I open the presentation again
the button doesn't work. If I copy the code to a new presentation it works
fine until I exit.

I'm obviously missing something. Any help greatly appreciated.
 
J

Jeff

I've set the macro security all the way down to low and it doesn't seem to
make any difference
 
D

David M. Marcovitz

After setting it to Low, close PowerPoint and then try. Once the
presentation is opened, its fate with macro security is set until it is
opened again so changing while the presentation is open won't make any
difference this time, but it should help for next time you open it.
--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
J

Jeff

Thanks to David and John. All working fine now.

David M. Marcovitz said:
After setting it to Low, close PowerPoint and then try. Once the
presentation is opened, its fate with macro security is set until it is
opened again so changing while the presentation is open won't make any
difference this time, but it should help for next time you open it.
--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top