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


Download 1.37 Mb.
Pdf ko'rish
bet128/191
Sana08.05.2023
Hajmi1.37 Mb.
#1442581
1   ...   124   125   126   127   128   129   130   131   ...   191
Bog'liq
2.2. Powerful PowerPoint For Educators

Sub MakeNotDirty()
ActivePresentation = True
End Sub
Sub Save()
ActivePresentation.Save
End Sub
Sub Quit()
Ap 
plication.Quit
End Sub
Sub QuitAndSave()
Save
Quit
End Sub
In computer terms, a pre sentation that is changed but not saved is called dirty.
The status of the current presentation (whether it is dirty or not, i.e., whether it
has been changed or not since the last time it was saved) is stored in the variable
ActivePresentation.Saved'>ActivePresentation.Saved
. Even if the presentation has been changed, we 
can fool PowerPoint into think ing that it hasn’t been changed by setting the
ActivePresentation.Saved
to 
True
as in the 
MakeNotDirty
pro ce dure
above. If you call this pro cedure (or simply put the line 
ActivePresentation.
Saved = True
into some other pro cedure), PowerPoint will not ask you if you
want to save the pre sentation when you quit. Be sure you do this every time you
make a change be cause the next change you make will make the pre sentation
dirty again, set ting
ActivePresentation.Saved
back to
False
.
You prob ably want to do this right away when you make a change. In fact,
you should do it in the procedure that makes the change. For ex ample:
128 More Tricks for Your Scripting Bag


Sub StartAgain()
ActivePresentation.SlideShowWindow.View.GotoSlide (1)
ActivePresentation.Slides(printableSlideNum).De 
lete
ActivePresentation.Saved = True
End Sub
This procedure is from the example in “How Did You Do: Re porting Results to
the Teacher” in Chapter 7. This procedure jumps to the first slide and deletes the
last slide (which had been cre ated tem porarily in an ear lier procedure). Once it
deletes the last slide, the pre sentation is dirty, but we don’t want any one to be
asked to save it. By setting

Download 1.37 Mb.

Do'stlaringiz bilan baham:
1   ...   124   125   126   127   128   129   130   131   ...   191




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