how do I change this code so it will work?

M

Mr . .

This code works fine in a macro that is called a minute after the last slide
is displayed, when it is shown as a powerpoint presentation.

I want to lock the keyboard out, force the viewer to see the entire
presentation, which is doable by saving the presentation as a powerpoint
show.

However, when viewed as a powerpoint show, the macro does not work.
How can I change the code to get it to work in a powerpoint show?

I'm not a programmer as you can imagine!



' Get a reference to the PowerPoint Application
object. Set appPowerPoint = CreateObject("PowerPoint.Application")
' Close the presentation.
appPowerPoint.ActivePresentation.Close
' Quit PowerPoint.
appPowerPoint.Quit
' Close the object variable.
Set appPowerPoint = Nothing
 
J

John Wilson

Have you considered saving as a .pps with slide show>set up show = browsed at
kiosk.

The keyboard will be locked and navigation only by action buttons /
hyperlinks. You could even set a delayed entrance animation for the buttons
to "force" the client to wait before pressing them.
--

Did that answer the question / help?
_____________________________
John Wilson
Microsoft Certified Office Specialist
http://www.technologytrish.co.uk/ppttipshome.html
 
M

Mr . .

Yes, that is what I have done, the macro code works when I view the
presentation as a normal powerpoint presentation. When I save the file as a
..pps or powerpoint show, the macro code does not run when the hyperlink is
clicked. Something to do with the code being written to close a powerpoint
presentation, but not a powerpoint show.

So when a viewer clicks the link, the standard outlook security email window
pops up (behind) the powerpoint show, and because it is not visible, the
viewer cannot click the 'yes' to allow outlook to send the already encoded &
formatted email to me letting me know that they finished viewing the
'training' show. Their machine is essentially 'locked' because the
powerpoint show prevents keyboard use, and since they cannot click the yes
button, they cannot leave the show, which is the problem.

The macro code below closes a 'presentation' but not a 'show'. By clicking
the link, the macro code runs, closes the presenation, which reveals the
outlook security window and the viewer can click the 'yes' button, and go
about their merry way. I get the email and they get credit for having
'viewed' the mandatory training that they missed on the scheduled training
day.

So if I can get some experts to look at the code, revise it for a powerpoint
show, or teach me how to, I hope to get the code to work with a 'show'.

Anyone have suggestions?
mr.
 
M

Mr . .

You are correct, I did not post all the code associated with sending the
email, etc. Primarily because I know that portion of the code functions
correctly, as does the code I posted, but only in powerpoint and when saved
as a .ppt and viewed as a presentation.

I will modify the code as mentioned, to reflect only application.quit and
then save it as a .pps powerpoint show and see if it works then. If it does
quit the powerpoint show, then the outlook security window will be visible,
and the viewer can click 'yes' and the email will be sent.

Mr.


Steve Rindsberg said:
I get the feeling that you haven't posted the entire chunk of code.
It's also not clear where you're running the code from, PowerPoint or some
other external app.

If from within PPT, you don't need to manage all the PPT object references;
you're in PPT, they're already there, so to speak, so this should be enough:
 
M

Mr . .

Good Evening,

Here is the code, it works in presentation mode but not in powerpoint show
mode. I really could use some help with fixing the code so it will work in
powerpoint show mode, so viewers cant 'fast forward' slides to the end and
still get credit for viewing the training.

Mr.



Sub Sendemail()

' Macro created 1/24/2006 by Mr.
Dim OL As Outlook.Application
Dim Mail As MailItem

Set OL = CreateObject("Outlook.Application")
Set Mail = OL.CreateItem(olMailItem)
Mail.Recipients.Add (e-mail address removed)
Mail.Subject = "Training powerpoint completed"
Mail.Body = "I completed viewing the required Training powerpoint
presentation. Please mark me as training complete."
Mail.Send
Set Mail = Nothing
Set OL = Nothing
' Quit PowerPoint.
Application.Quit
' Close the object variable.
Set appPowerPoint = Nothing


End Sub

Mr . . said:
You are correct, I did not post all the code associated with sending the
email, etc. Primarily because I know that portion of the code functions
correctly, as does the code I posted, but only in powerpoint and when saved
as a .ppt and viewed as a presentation.

I will modify the code as mentioned, to reflect only application.quit and
then save it as a .pps powerpoint show and see if it works then. If it does
quit the powerpoint show, then the outlook security window will be visible,
and the viewer can click 'yes' and the email will be sent.

Mr.
 

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