TeachingAtCuracaoIsFun was telling us:
TeachingAtCuracaoIsFun nous racontait que :
Hi there,
for educational purposes I would like to be able to show students
some basic skills through Word Macros. For that reason, the macros
would have to be played back at a slow pace. Even nices it would be
if it could be stopped, rewinded, forwarded etc. almost like a video.
Any ideas?
You could run the macro in step-by-step mode.
Open the VBA editor, place the cursor inside the Sub you want to show. Don't
minimize the VBA code window, but make it as small as possible. What I like
to do is to make the VBA window the width of the screen, turn off all
toolbars and size the height of the window so that I can see only 2 lines of
code at the time, but it depends on the code itself.... if you want to show
a loop, then it might be useful to see the whole loop... Then I place that
VBA code window at the bottom of the screen.
Next, I size the Word window to occupy the space above the VBA window.
Again, I turn off as many toolbars as possible so as to maximize real state
space. Of course, this will not work well with a 800x600 screen
resolution...
Finally, when I have everything as I like it, I run the macro step by step.
Hit F8 with the VBA window active. Each macro line will be highlighted in
yellow one at the time, every time you hit F8 the current yellow line
executes. If you want, you can go back by dragging up the yellow arrow in
the small margin on the left. If you do that, go back to the document before
hitting F8 and undo the necessary action(s). This would be your "play back"
For "fast forward", find a spot in the macro where you want the execution to
stop and click next to that code line in the left margin to insert a stop.
The line will be highlighted in maroon and a maroon dot will appear in the
margin. Hit F5 and the execution will go non stop to that point where it
will stop highlighted in yellow. Then you can either hit F5 or F8...
See the Debug menu for more options.
Also useful, is to display the Locals window so that we can see what is
happening with variables. See the View menu.
Sound complicated, but once you get the knack for it, it is easy to set up.
You can also just have the Word window at full size and float the small VBA
window on top. This is what I do as it takes less time to set up (My default
"small" VBA window size is wide and not short). Then, if you click on the
document window, you have to click on the taskbar to get the code window
back. This is not a big thing, but for educational purposes, it might be
better to have both window on at all times...
HTH
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site:
http://www.word.mvps.org