Automating Powerpoint from VB

  • Thread starter Thread starter Jim M
  • Start date Start date
J

Jim M

Does anyone have some good sample code to display one powerpoint slide from
a presentation in VB code. I would like to create a simple menu that will
allow me to show slides from a variety of powerpoint presentations.

Limited overhead would be good.

Thanks in advance.
 
I have a set of Math CBT presentations I did in PowerPoint that I created a
VB program as a simple front end. Below is the code I used to open one of
the four CBTs based on the OptionButton you click:

=======Start of Code=======

Private Sub cmdOK_Click()
If Option1 = True Then
Call ShellExecute(0, "SHOW", "c:\cbt\math\basic\basic math.ppt", 0,
0, 1)
ElseIf Option2 = True Then
Call ShellExecute(0, "SHOW", "c:\cbt\math\geometry\geometry.ppt", 0,
0, 1)
ElseIf Option3 = True Then
Call ShellExecute(0, "SHOW", "c:\cbt\math\algebra\algebra.ppt", 0,
0, 1)
ElseIf Option4 = True Then
Call ShellExecute(0, "SHOW", "c:\cbt\math\trig\trig.ppt", 0, 0, 1)
End If
End Sub

=======End of Code=======
Bill Foley
www.pttinc.com
 
Not sure, never tried it. This method opens a presentation in Show Mode at
the opening slide. Since I never had a reason to open it anywhere else, I
haven't researched or tested anything.

Bill
 
Modify the code like this:

Call ShellExecute(0, "SHOW", _
"c:\cbt\math\basic\basic math.ppt #10", 0, 0, 1)

This will should start the show on slide 10.


B
===============
Please spend a few minutes checking out www.pptfaq.com This link will
answer most of our questions, before you think to ask them.

Change org to com to defuse anti-spam, ant-virus, anti-nuisance
misdirection.
 
Thanks B! I'll have to try it out sometime. Like I said, I never had a
need to open anywhere other than the first slide, but there is always a
first time!

Bill
 
Hello Jim,

If you (or anyone else reading this message) think that this kind of slide
reuse scenario should be supported in PowerPoint (without having to resort
to VBA 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
Microsoft Corporation
Supportability Program Manager
Microsoft Office PowerPoint for Windows
Microsoft Office Picture Manager for Windows

For FAQ's, highlights and top issues, visit the Microsoft PowerPoint
support center at: http://support.microsoft.com/default.aspx?pr=ppt
Search the Microsoft Knowledge Base at:
http://support.microsoft.com/default.aspx?pr=kbhowto

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
 
What you want to do is easily done with hyperlinks on a single slide. This
gives you the advantage of already having powerpoint (or the Viewer) open
and running, so the linked "destination" presetation will open and show
faster.

You can create a one-slide "menu" presentation that contains the links. The
links can be either text or thumbnails of the slides. If you don't want the
user to be able to play the entire destination presentation, then you can
create eliminate the other slides, or just paste images of the destination
slides into the menu presentation. Save the menu presentation as a .pps and
it will play when double-clicked.

Alternatively, if you just want to show the user images of the destination
slides from a running VB program, you'll use much less overhead if you just
let VB show a static image of the slide, wihtout starting Powerpoint at all.

Finally, if you really want the user to see your oh-so-cool animation on the
ppt slides, you can also record them as an avi movie and let VB use an MCI
call to play back the avi. Again, less overhead then loading Powerpoint,
and no requirement that powerpoint be installed on the user's machine.

Good luck
 
Back
Top