Link to a powerpoint slide from an Access form (1 Viewer)

PhilC

New member
Local time
Today, 02:40
Joined
Nov 6, 2019
Messages
6
I have a large collection of quizzes, written in Powerpoint 2007. Each quiz consists of a number of rounds, usually 10. Each round has 10 questions. So, a typical quiz presentation consists of around 150 slides, what with intros and answer slides etc.

I have created an Access 2007 database containing all the above quizzes, Fields include the date of the quiz, the organization that commissioned the quiz, the path to the Powerpoint quiz. The latter field is a hyperlink type. So, when I click on the hyperlink Powerpoint opens with the particular quiz loaded.


BUT, while that is fine and dandy, I would like to open the Powerpoint file at a specific slide number, not slide 1 which is always the default of the hyperlink.


Does anyone know how to direct the Powerpoint file to open at a specific slide? I suspect the answer is going to involve VBA, which is not a problem, but how?


Hope someone can help. I'll be eternally grateful.


Thank you
 
Last edited:

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:40
Joined
Oct 29, 2018
Messages
11,090
Hi Phil. Have you tried adding the slide number after the filename?
 

PhilC

New member
Local time
Today, 02:40
Joined
Nov 6, 2019
Messages
6
Hello Mark,


Thanks for helping.


The path and filename for the powerpoint file is held in the pathlink field of a table named tblQuiz. For example c:\quiz\Scouts\2012Scouts.pptx The pathlink field is a hyperlink type. When I click on the pathlink field powerpoint opens the correct file.



Can I add the slide number, as you suggest, in a hyperlink type field?


I'll give it a try.


Thanks
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:40
Joined
Oct 29, 2018
Messages
11,090
Hello Mark,

Thanks for helping.

The path and filename for the powerpoint file is held in the pathlink field of a table named tblQuiz. For example c:\quiz\Scouts\2012Scouts.pptx The pathlink field is a hyperlink type. When I click on the pathlink field powerpoint opens the correct file.

Can I add the slide number, as you suggest, in a hyperlink type field?

I'll give it a try.

Thanks
Hi Phil. The one Mark suggested is a command line switch, so it probably won't work, but you could try it out. The one I suggested may work for hyperlinks, but I haven't tried it.
 

Cronk

Registered User.
Local time
Today, 11:40
Joined
Jul 4, 2013
Messages
2,403
You could try something like
Code:
strFile =dLookup("FileName", "tblQuiz", "Quiz=" & cboSelectQuiz)
strSlideNo = inputbox "What is selected slide to start" & 
Shell "C:\Program Files\Microsoft Office\Office15\POWERPNT.EXE" & chr(34) & strFile  &"/N" & strSlideNo &  chr(34)
I guessed field names and controls that you might use and you should change the path to power point if necessary.
 

PhilC

New member
Local time
Today, 02:40
Joined
Nov 6, 2019
Messages
6
Hello Gasman,


I have tried your stackoverflow suggestion, but it failed with error 438 at the code line "Set PPSlide = objPPT.Slides(5)". A great shame as I can see that this simple code has the potential to solve my problem. Any further help very welcomed.


Thanks for the reference. I have not yet looked at your other suggestion.


I have also tried DBGuy's command line switch, but that didn't work. It seems hyperlink fields cannot cope with such, as we suspected.
 

Gasman

Enthusiastic Amateur
Local time
Today, 02:40
Joined
Sep 21, 2011
Messages
6,302
If you look at the other link, from Microsoft they use a simple .Select

This worked for me?

Code:
PPTPrez.Slides(5).Select
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:40
Joined
Oct 29, 2018
Messages
11,090
I have also tried DBGuy's command line switch, but that didn't work. It seems hyperlink fields cannot cope with such, as we suspected.
Hi Phil. It was Mark who suggested the command line switch. I suggested to continue using the hyperlink but add the slide number as a bookmark. I just tried it myself and it worked for me. However, the PowerPoint file has to be open first for it to work. So, you can either ask the user to click on the link twice, or offer two links: the first one to open the file and the second one to jump to a specific slide.
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 21:40
Joined
Feb 19, 2002
Messages
29,158
150 slides??? Are you interested in making this more efficient? There are simple ways to make questionnaires, surveys, etc using a relational database where you don't have to hard-code the presentation layer. Using a normalized table approach, you would end up with ONE slide for questions and Access could just fill it with the next set of questions.
 

PhilC

New member
Local time
Today, 02:40
Joined
Nov 6, 2019
Messages
6
Thanks Pat,


I appreciate your contribution and I would love to pursue your offer at some point in the future. But at the moment I need to get this current problem resolved so I can search my existing huge powerpoint collection.


I'll be back!



Who said that?
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 21:40
Joined
Feb 19, 2002
Messages
29,158
The "governator"

When you're ready, we're here.
 

PhilC

New member
Local time
Today, 02:40
Joined
Nov 6, 2019
Messages
6
Hello All,


Solved!


The code now looks simple, but it was anything but to get there. I would never have got to this point without ALL your contributions.


The code for my form button reads:


Code:
Dim strFile, strShell As String
Dim strSlide As String

strFile = Me!PathLink
strSlide = Me!QuizID
strShell = "C:\Program Files (x86)\Microsoft Office\Office12\pptview.exe" & " /S" & " /N" & strSlide & " " & strFile

Shell strShell, vbNormalNoFocus
The solution sprang when I realized that the /N switch has a different effect for powerpnt.exe as it does with pptview.exe


Anyway, matter is solved very satisfactorily and I have to thank every one of you . Hope our paths cross again when I might be able to help you.


Cheers Guys.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:40
Joined
Oct 29, 2018
Messages
11,090
Hi Phil. Congratulations! Glad to hear you got it sorted out. Good luck with your project.
 

Mark_

Longboard on the internet
Local time
Yesterday, 18:40
Joined
Sep 12, 2017
Messages
2,111
Glad to see you got it working!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom