PDA

View Full Version : Solved: Powerpoint Slide Show Link



Saxylady1964
03-05-2009, 09:32 AM
I have a form with a number of checkboxes, textboxes etc. It is protected. I would like to create some links to different powerpoint slide shows (.pps) within the protected form. I tried hyperlinks, but they are not usable in a protected form, so I've created buttons, but am having difficulties with what the code should be to open/run the slideshow.

lucas
03-05-2009, 04:57 PM
This works for me. the ppt file has to be in the same directory as this file and it works for .pps also.
Option Explicit
Private Sub CommandButton1_Click()
On Error GoTo 1
ThisDocument.FollowHyperlink (ThisDocument.Path & "\test.ppt"), NewWindow:=True
Exit Sub
1: MsgBox Err.Description
End Sub

if you copy it to a new doc and it's not saved it won't work because it uses thisdocument path to look for the file to open.


be sure to change the name of the ppt in the code to match your file.

fumei
03-06-2009, 10:55 AM
Just remember that this only applies to ActiveX control commandbuttons (from the Controls Toolbar). And, the code needs to be in the ThisDocument code module.