Powerpoint 2000 VBA

P

Per Mutations

Any help with the following will be greatly appreciated.

Having created a simple ppt of about 20 slides I decided to jazz things up a
bit by making it more interactive using VBA.
Not being proficient in VBA I paid a visit to Shyam's web pages (good man
there!) and successfully installed code to swap linked images on the slide
master and change text fields on individual slides during a slide show.

An unanticipated side effect of this interactivity is that the slides have
not resorted back to the original graphics and text when next running the
slide show.

It would appear therefore that I need to initalize the graphics and text to
their original states when the slide show loads/starts.

How do I go about achieving this or is there a setting somewhere that
prevents changes during a show being stored permanently. If VBA is necessary
I need a noddy explanation and sample code if possible as anything complex
will scramble the old grey matter.

TIA

Pete
 
S

Steve Rindsberg

An unanticipated side effect of this interactivity is that the slides have
not resorted back to the original graphics and text when next running the
slide show.

It would appear therefore that I need to initalize the graphics and text to
their original states when the slide show loads/starts.

Or make sure you don't save the presentation while it's in its changed
state.
I haven't seen the specific code you're using; does it save the presentation
at any point?

Or perhaps have an End Show button at the end that runs a bit more VBA to
re-initialize the presentation, save it, then quit.
 
P

Per Mutations

Thanks for getting back so quick Steve.

In answer to your question, no the presentation does not save at any point.

I could have a last page that will restore the original graphics/text but
the presentation has been built for primary school teachers as a "template"
quiz for whichever subjects they choose by entering their own questions and
answers. Schools being what they are, as soon as the lesson bell goes the
kids want out or the lesson subject changes.
I don't believe this is conducive to a proper ending of the slide show and
although ppt asks whether the changes should be saved when shutting ppt
down, not all teachers are proficient enough or perhaps attentive enough at
busy times to answer the question correctly.
Given the situation I believe the safest solution would be to have a
procedure that runs when the slide show starts to restore the original
objects. Unfortunately I don't know how to do this so any further help would
be appreciated.

Thanks
 
J

John Langhans [MSFT]

Hello Pete,

If you (or anyone else reading this message) think that PowerPoint should
provide some kind of built-in option for a presentation (which has been
modified during slide show) reverts to its state prior to the beginning of
slide show (without having to resort to VBA and/or add-ins), don't forget
to send your feedback to Microsoft at:

http://register.microsoft.com/mswish/suggestion.asp

As with all product suggestions, it's important that you not just state
your wish but also why it is important to you that your product suggestion
be implemented by Microsoft. Microsoft receives thousands of product
suggestions every day and we read each one but, in any given product
development cycle, there are only sufficient resources to address the ones
that are most important to our customers so take the extra time to state
your case as clearly and completely as possible.

IMPORTANT: Each submission should be a single suggestion (not a list of
suggestions)

John Langhans

Supportability Program Manager
Microsoft Office PowerPoint for Windows
Microsoft Office Picture Manager for Windows

This posting is provided "AS IS" with no warranties, and confers no rights.

Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 
P

PTT, Inc.

What I have done in the past is to include the following line of code at the
end of the last macro run during a presentation. It basically tell
PowerPoint that it is already saved so the question never gets asked when
closing. This way the user will NEVER save the presentation (especially if
it is a PPS) since most times it enters and leaves in Slide Show Mode. Here
is the simple line of code:

ActivePresentation.Saved = True

Keep in mind that if you want the file saved, the only way to save the PPS
file would be to open PowerPoint first, then open the file, then click the
"Save" button since it won't ask you when you close it out.

Hope this helps!

Bill Foley
www.pttinc.com
 
P

Per Mutations

Many thanks Bill for your support, that's a really useful tip.

The reality is that the presentation will not always reach it's conclusion.
It is more likely that the show will end by right-clicking a slide and
choosing 'end show' and then simply closing down the window.

The problem of tidying things up at the end of the presentation is that the
end is not always reached. Once I hand over the presentation to the user,
( who enter their own text), the control of the presentation goes with it. I
need a foolproof method of preventing the presentation from changing all the
users' hard work so they can reuse the presentation at a later date.

I suppose my question should have been approached from a different angle,
i.e. in Power Point 2000 is it possible to run a VBA module automatically
when:
a) a slide show starts or ends
b) a slide is exited or
c) a new slide is displayed

The problem is that the only way I know to run a VBA module is when a user
action triggers it by clicking an object on a slide.
I need to know whether a system event as stated above can trigger some code
to be run. If I can put a module together that will be triggered by a system
event, I believe I will have cracked it.

Once again, many thanks

Pete
 
P

Per Mutations

Thanks John, I'll certainly do that.

A facility like this would certainly ease my headache.

I may be missing a key bit of PP functionality here but I assumed that the
default was for PP not to store changes during a presentation and so provide
the ability to rerun the presentation in scenarios such as sales pitches
and, in my case, teaching.
I emphasise that this is not a criticism of PP which the students in our
school, and my own kids, enjoy using, but rather my perception of
presentation reusability.
I fully accept that by altering a presentation mid-stream using VBA one is
'mucking about' with the presentation content.

This leads to 2 scenarios:
1) Using PP as a REUSABLE presentation in which changes during the slide
show are not retained as for teaching etc.
2) Using PP as a feedback mechanism by which choices made during a slide
show are retained as for business decisions etc.

It would be interesting to know whether scenario2 is widespread practice or
whether scenario1 is the more prevalent.
The answer could decide which should be the default setting.

Just some thoughts.

Cheers
 
S

Steve Rindsberg

In answer to your question, no the presentation does not save at any
point.

Via code, but from what you mentioned later, the teachers are probably
allowing it to save the changes, so net: same thing.
I could have a last page that will restore the original graphics/text but
the presentation has been built for primary school teachers as a "template"
quiz for whichever subjects they choose by entering their own questions and
answers. Schools being what they are, as soon as the lesson bell goes the
kids want out or the lesson subject changes.

You could put an EXIT button on the slide master (so it appears on each
slide).
That could invoke a macro that does the reset. Still, you can lead the
teacher to the exit button but you can't make 'em push it.

A procedure that runs when the show starts would be great but it's not
possible in some versions of PPT and requires an installed addin in others.
There's no way to make a standalone PPT file run code automatically.

It's difficult to make specific suggestions w/o knowing how you run the
presentation and how you navigate it, but one possibility is to have the
main presentation include an action button with code that opens NOT the
actual original presentation but a copy of it. If the teacher saves the
copy, no harm done because you're going to overwrite it with a new copy the
next time you run the show.
 
P

Per Mutations

Thanks once again Steve,
Via code, but from what you mentioned later, the teachers are probably
allowing it to save the changes, so net: same thing.
Point taken.
I'm taking everything that's being said onboard.

The direction my mind is taking at the moment is to have an initialisation
button as suggested but not at the end of the presentation, rather at the
beginning.
The logic behind this is that it is possible to quit a presentation before
the end but the nature of the quiz means it will always need to start at the
beginning.

Hell, I might even be a devil and put a button at both ends. Belts and
braces, or is it collars and cuffs?

One other question - is it possible to force PP2000 to always start at a
particular slide, i.e. the first?

Cheers

Pete
 
B

Brian Reilly, MS MVP

Pete,
I'm jumping in here late after the great help you've gotten from my
good friends Steve and John. In addition to what they've said I might
try to add a concept here to help you out.

First think of using the kiosk mode which will eliminate the keyboard
and force the user to using the Navigation buttons you put on the
page. Use a global variable to define a clickcount and right a simple
function to say something like if clickcount = 1 then goto slide(n)
where n is probably your first or second slide.
Without testing, we'll leave that to you as a learning experience (g),
you could also probably call this puppy a pps file which would always
open in slideshow on page 1. The the Next button (your own Navigation
button) would not only reset the images but also go to your first
slide which would be page(2).

Think of the opening page as a way to workaround the AutoOpen lack in
PPT. If you can capture a click or even a mouseover you can imitate
that AutoOpen behavior (sort of (g)),

Just my rambling thoughts.

Brian Reilly, PowerPoint MVP
 
S

Steve Rindsberg

The direction my mind is taking at the moment is to have an initialisation
button as suggested but not at the end of the presentation, rather at the
beginning.
The logic behind this is that it is possible to quit a presentation before
the end but the nature of the quiz means it will always need to start at the
beginning.

I like it. The presentation starts up and the user finds that, since you've
cunningly set it to Kiosk mode, there's no way forward but to press the
button that you've cleverly marked "Forward". You sneaky devil you. That
does all your reset work for you. Bingo.

One other question - is it possible to force PP2000 to always start at a
particular slide, i.e. the first?

Wellsir. PPT saves whatever view you were in when you last saved the
presentation and restores that when you open the pressie again.
But if you rename the PPT to PPS, it'll open at slide 1, in slide show view,
when the user doubleclicks the PPS file icon.
Would that do it for you?
 
P

Per Mutations

Ok Brian, if you're sorting the men out from the boys, pass me my dummy.

Kiosk mode. Uh?
Global variable. Uh? Uh?

I get the gist of what you're proposing but seriously I'm so far out of my
depth here I'm looking into the Hellmouth.

As you say, there's a learning experience here so while I check things out
let me thank you for your support.

Cheers

Pete

Going down
..
..
..
..
 
B

Brian Reilly, MS MVP

Pete,
I actually think you got it in your last post to Steve. But let me
assume you didn't and provide some steps here.

1. Change the SlideShow setup to be a Kiosk (Slide show + Set up show
+ View as Kiosk) (no vba required- right from the menu). This
basically disables the keyboard except for the Esc key.
2. No you have to add buttons to navigate, like Next, Back, Puke, etc.
Built in Next Back Home etc. have built in code attached to them which
should be obvious. The custom button "Puke", you'd want to attach your
own macro to as a mouse-over or mouse-click (hoping you know how to do
that or say and somebody, like Steve, will jump in with that.

3. So nobody can go anywhere except from your navigation buttons,
excepting the Esc key which Chirag's code can handle, but you may not
need it.

4. So you should be set, if not overly confused. If confused, ask
again. Steve can fill in here. He re-writes my code all the time, at
least till I stop letting him (g). I may have time as well. Really
quite straight forward if we knew exactly what constraints you wanted
by page

Regards,

Brian Reilly, PowerPoint MVP
 
P

Per Mutations

"I like it. The presentation starts up and the user finds that, since
you've cunningly set it to Kiosk mode, there's no way forward but to press
the button that you've cleverly marked "Forward". You sneaky devil you.
That does all your reset work for you. Bingo."

Tiptoeing evil one indeed but unfortunately I can't claim credit for the
kiosk mode. I'd never heard of it till Brian and yourself mentioned it.

It would certainly seem the way to go if I were giving the presentation.
However the key to the problem is that I set up the presentation with the
master details, background, all the graphics, hidden screens, VBA, text
boxes, etc., and then hand over the presentation to the teacher who type
their own text into the text boxes. This way the teacher can specify their
own content and vary it by subject but all with a consistent look and feel.
I don't want to make things too complicated for the teachers as they have
enough to do, so essentially I want them to type and save with no other
complicated setting up.

As I said to Brian I've never used kiosk mode and don't know if that is
mutually exclusive to saving the file as a PPS so I need to look into it to
see if it will fit into current working practices.

Thanks for your help

Pete

Now where's that assistant?
 
P

Per Mutations

Brian,

Thanks for this information, I believe the ball is now in my court to put
all the advice into practice.

I'll call an end to this thread while I do so. If I get stuck I'll ask on a
new thread.

I would like to take this opportunity to thank yourself, Steve and Bill for
all the assistance I have received.

Keep up the good work. It's appreciated.

Pete

P.S.

I'm not sure the Local Education Authority would appreciate buttons called
Puke floating around it's primary schools - it's slang. Maybe I'll call it
Vomit - providing it won't affect the functionality.

P.P.S.

I've taken up John's suggestion and proposed an option on PP at design time
to prevent VBA changes in a slide show being saved. I hope it comes to
fruition.
 
S

Steve Rindsberg

Tiptoeing evil one indeed but unfortunately I can't claim credit for the
kiosk mode. I'd never heard of it till Brian and yourself mentioned it.

Aha ... all the more devious of you. Getting us to do your work w/o your
even knowing you were doing it. ;-)

Let's see, then. Kiosk mode and PPS ... no problem, not mutually exclusive.

Making it easy for the teachers ... hmmm.
The game grid can stay consistent, but to do the "tag" trick I mentioned,
you'd need a way for them to add tags as needed. There's no UI in
PowerPoint for that.

Brian will probably tell you it'd be easiest to give them a spreadsheet so
they can fill in the Q'n'A and for once I'll agree with him before he even
says it. You'd then need a way to convert that to PPT tags.

If that sounds interesting, and you really want to give your VBA skills a
workout, c'mon back and let's talk.
 
P

Per Mutations

"If that sounds interesting, and you really want to give your VBA skills a
workout, c'mon back and let's talk."

Steve, I'd love to talk but I think we're speaking different languages -

what I know about VBA is gained from adapting code snippets from the mvp
site and trawling through the PP VBA help,

what I know about Excel makes me look like a guru in PowerPoint by
comparison,

come to think of it, what I know about anything isn't worth knowing,

on the upbeat side though, I know a lot about nothing and it's served me
well so far.

The progress to date is that I've successfully installed the initialisation
procedure onto the first page and all slides have working image swaps, timed
displays and text changes. I'm so pleased with myself I could almost whoop.

Just got to sort out this PPS/Kiosk thingymabob and then run it past the
teachers. If they're happy with it, we're done.
Aha ... all the more devious of you. Getting us to do your work w/o your
even knowing you were doing it. ;-)

Ignorance is bliss.

Dammit, the wife's using my pitchfork to toast marshmallows again. Got to
get it back.

Cheers.

Pete
 
S

Steve Rindsberg

The progress to date is that I've successfully installed the
initialisation
procedure onto the first page and all slides have working image swaps, timed
displays and text changes. I'm so pleased with myself I could almost
whoop.

Go ahead. We won't tell anyone.
Just got to sort out this PPS/Kiosk thingymabob and then run it past the
teachers. If they're happy with it, we're done.

Bingo. If not, you know where to find us. We might hide, of course, but
that's the chance you take ...
Dammit, the wife's using my pitchfork to toast marshmallows again. Got to
get it back.

<g>
 
P

Per Mutations

Whoop whoop whoop!

There it's done and in public too, not bad for a stuffy, repressed
Englishman eh?

PPS/Kiosk now sorted and everything looking good.

Many thanks to all, keep up the good work.

Pete
 

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