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


Download 1.37 Mb.
Pdf ko'rish
bet38/191
Sana08.05.2023
Hajmi1.37 Mb.
#1442581
1   ...   34   35   36   37   38   39   40   41   ...   191
Bog'liq
2.2. Powerful PowerPoint For Educators

Help! I’ve Lost My Win dows
You’re adventurous. You like to play around. You were trying some things,
and you lost your Pro ject win dow in the VBA Ed itor. No prob lem. Keep play ing
around; it is the best way to learn. Oh yeah, and you want to get your Pro ject win -
dow back. Simply go to the View menu and choose “Pro ject Ex plorer.” What’s
that? You lost your module window, too? You are ad ven tur ous. Just dou-
ble-click on Module1 in the Pro ject Win dow, as shown in Figure 4.3.
Figure 4.3. Pro ject Win dow with Module1
If you don’t see Module1 in the Project win dow, but you do see Modules, you
should have a + next to Modules; click on that and you should see Module1. If
you don’t see Mod ules, but you do see VBAProject, you should have a + next to
VBAProject; click on that to see Modules, click on the + next to Mod ules to see
Module1, and dou ble-click on Module1 to see the Module1 win dow. Fi nally, if
you don’t see Mod ules, and you don’t see a + next to VBA Project, then you
don’t have a mod ule (either you never in serted it, or you de leted it). Go to the In-
sert menu, and choose “Mod ule,” and you should be OK.
If you accidentally add more than one mod ule, your mod ules will be num -
bered con secutively (Module1, Module2, Module3, . . . ). While it is not a prob -
lem to have more than one mod ule, you should avoid confusion by keeping all
your scripts in the same mod ule. Delete any ex tra modules by clicking on them
in the Project win dow and choosing “De lete Mod ule” from the File menu.
Tying Your VBA Script to a PowerPoint Button
Now that you have a script writ ten, you will want to ac cess it from within
PowerPoint. You can do this by associating the script with a but ton (or any draw-
ing shape that you want).
Tying Your VBA Script to a PowerPoint Button 43


Go to PowerPoint (either choose it from the Task Bar or close the Visual
Basic Ed itor by clicking on the in the up per right-hand corner of the screen;
on a Macintosh, choose “Close and Return to Microsoft PowerPoint” from the
File menu). Don’t worry about losing your VBA scripts when you close the edi-
tor. Your VBA scripts are part of your PowerPoint presentation. When you save
your pre sentation, your scripts will be saved with it. When you return to the ed i-
tor, your scripts will still be there.
If you don’t have a slide, cre ate a blank slide. Don’t worry about what kind
of slide it is or what is on it. Go to the Slide Show menu and se lect “Ac tion But-
tons.” From the flyout menu, pick any but ton (the blank one is fine be cause you
can add text to it later). See Fig ure 4.4 to see how to add a blank ac tion but ton.

Download 1.37 Mb.

Do'stlaringiz bilan baham:
1   ...   34   35   36   37   38   39   40   41   ...   191




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