Powerful PowerPoint for Educators: Using Visual Basic for Applications to Make PowerPoint Interactive


Download 1.37 Mb.
Pdf ko'rish
bet59/191
Sana08.05.2023
Hajmi1.37 Mb.
#1442581
1   ...   55   56   57   58   59   60   61   62   ...   191
Bog'liq
2.2. Powerful PowerPoint For Educators

Sub YourNameWithPraise()
YourName
DoingWell
ActivePresentation.SlideShowWindow.View.Next
End Sub
The line that we added moves to the next slide. Don’t worry how it does it; just
remember that any time you want to use VBA to move to the next slide, you can
insert that line into your pro cedure.
Imagine a ti tle slide of your pre sentation. The only but ton on the slide
would be as 
sociated with this pro 
cedure (of course, you would need the
YourName
and 
DoingWell
pro 
cedures in your module, but only
YourNameWithPraise
would be tied directly to a but ton). When the user
clicks on the but ton,
YourName
is called (the user is asked to type a name),
DoingWell
is called (the user is told by name, “You are do ing well”) and the
pre sen ta tion au to mat i cally be gins by mov ing to the next slide.
Of course, you don’t always want to go to the next slide. To move around
within your presentation, you can use any of the fol lowing:
ActivePresentation.SlideShowWindow.View.GotoSlide (3)
Go to slide 3
ActivePresentation.SlideShowWindow.View.GotoSlide (4)
Go to slide 4
ActivePresentation.SlideShowWindow.View.Next
Go to the next slide
ActivePresentation.SlideShowWindow.View.Pre 
vi 
ous
Go to the pre vious slide
ActivePresentation.SlideShowWindow.View.First
Go to the first slide
ActivePresentation.SlideShowWindow.View.Last
Go to the last slide
ActivePresentation.SlideShowWindow.View.Exit
Exit the slideshow
Navigation: Moving from Slide to Slide 65


With the first statement, you can go to any slide in the presentation. Simply re -
place “3” with the num ber of any other slide. The only difficulty is that if you
change the or der of your slides, in sert a new slide, or de lete a slide, you will have
to change the num ber. In Chap ter 8, we will discuss nam ing slides. You will be
able to set the names for your slides and use the name to go to a particular slide.
The ability to move around can be very powerful, particularly when the
slide to which you want to go is based on something the user types or does. The
next sec tion re veals some se crets of

Download 1.37 Mb.

Do'stlaringiz bilan baham:
1   ...   55   56   57   58   59   60   61   62   ...   191




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling