Results 1 to 12 of 12
  1. #1
    Join Date
    May 2006
    Posts
    386

    Unanswered: Can I open a powerpoint slide in full screen on "Exit event" of a command button

    Dear Friends,
    I had posted this a few days ago but no luck so far !
    On my database and on "Exit" button when I put the codes on the exit event procedure of the CmdExit button, it does exit and then immediately after it opens the required powerpoint (pps) file but it opens it in normal maximized window and the slide show doesnt automatically appear as a slide and it only appears as a normal maximized window.

    Is it possible that on exit event procedure of the CmdExit button, the powerpoint (pps) file (slide) should open as a full screen slide and after the slide finishes its animations, it should then automatically exit or just wait for the user to click on powerpoint slide to close. I must say it is a pps file which means when you normally click on te file it opens it in full screen and it automatically closes and when the user clicks it then exits.

    Following is the code I have used.

    Code:
    Private Sub cmdExit_Exit(Cancel As Integer)
    Dim Powerexe As String
    Dim FileName As String
    Dim Ret
    Powerexe = "C:\Program Files\Microsoft Office\OFFICE10\POWERPNT.EXE"
    FileName = "\\NTSERVER\Users\ehaidari\My Documents\Emal's Docs\EXPRESSDB-OCT-05\GOODBYE.pps"
    
    exe = Chr(34) & Powerexe & Chr(34) & " " & Chr(34) & FileName & Chr(34)
    
    
    Ret = Shell(exe, vbMaximizedFocus)
    
    End Sub

    Your kind help would be much appreciated.

    regards
    Emal
    Emi-UK
    Love begets Love, Help Begets Help

  2. #2
    Join Date
    May 2005
    Posts
    119

    Talking

    OK - you can do this as a hyperlink.

    Here's my code that works really well for opening powerpoint shows. I added in the Quit command, since that's what you were looking for.

    Private Sub gotoLink_Click()
    On Error GoTo err_gotoLink_Click
    Dim strInput As String
    strInput = "FullURLPathAndFileName.xxx"
    Application.FollowHyperlink strInput, , True
    DoCmd.Quit

    exit_gotoLink_Click:
    Exit Sub
    err_gotoLink_Click:
    MsgBox (Err.Description)
    Err.Clear
    Resume exit_gotoLink_Click
    End Sub

    I hope this helps!
    ~Krista

  3. #3
    Join Date
    May 2006
    Posts
    386
    Hi Krista,
    But my powerpoint slide will be saved in my computer. I mean in c drive, so what should I write in " FullURLPathAndFileName.xxx".

    Your assistance would really be appreciated.
    Regards
    Emi-UK
    Love begets Love, Help Begets Help

  4. #4
    Join Date
    May 2006
    Posts
    386
    Hi Krista again,
    I have entered your code and it works fine Except when it opens the powerpoint slide and after it finishes its animations, then the message comes which says " End of Slide. Click to Exit. BUT when I click then I get another windows that says " If you end the show the presentation will close and the web toolbar will no longer contain the list of documents you jumped to previously. If you want to edit slides, Use the Edit Slides command button on the Edit Menue. Do you really want to End the slide show? "

    Could you please suggest anything else so that after the slide animations finsih and after I click on the End Slide Show, then the whole powerpoint window should exit? Exactly like when you open/double click on a powerpoint show (pps) file which exits after the animations finish.

    Thank you for your time and assistance.
    with regards
    Emal
    Emi-UK
    Love begets Love, Help Begets Help

  5. #5
    Join Date
    May 2005
    Posts
    119
    hmmm... I see what you're saying.
    Now it's a personal challenge.

    (I just finished a big project at work, and I am taking a break today!)

    We'll figure this one out together!

  6. #6
    Join Date
    May 2005
    Posts
    119
    Ok here goes round two...

    Function RunPPShow()
    Dim oPPTApp As PowerPoint.Application
    Dim oPPTPres As PowerPoint.Presentation
    Dim PresPath As String
    PresPath = "Q:\klgdata\powerpoint\cwapresentation.pps"
    Set oPPTApp = CreateObject("PowerPoint.Application")

    With oPPTApp
    Set oPPTPres = .Presentations.Open(PresPath, msotristate, , msotrue)

    With oPPTPres
    With .SlideShowSettings
    .Run

    End With
    End With
    End With
    End Function

  7. #7
    Join Date
    May 2006
    Posts
    386
    Hi Krista,
    Thank you for your prompt reply. Are you suggesting that I have to replace the old code and replace is with the one you have given above?

    Also, where exactly and on which Event Procedure should I paste this code? Thank you very much for your help.

    Regards,
    Emal
    Last edited by Emal; 09-21-06 at 07:20.
    Emi-UK
    Love begets Love, Help Begets Help

  8. #8
    Join Date
    May 2005
    Posts
    119
    You can replace the previous code with this code. I actually put a reference to this (runppshow) in my event procedure for the button.

    I forgot to mention that you'll need to add "Microsoft Office Powerpoint..." to your current references, if you don't already have it selected.

  9. #9
    Join Date
    May 2006
    Posts
    386
    Can you please write to me how to put the reference and etc? because when I replaced the old code with your new suggested one, it didnt work. Because the command button is CmdExit and the event procedure is on on Click.
    and your code is ( Runppshow). Is it possible to write the code please?
    Emi-UK
    Love begets Love, Help Begets Help

  10. #10
    Join Date
    May 2006
    Posts
    386
    This is where and how I have pasted the code on Click Event Procedure of the Exit button but it doesnt work, when I click on the button it highlights the Private Sub CmdExit_Click() in yellow

    Private Sub CmdExit_Click()
    Function RunPPShow_Click()
    Dim oPPTApp As PowerPoint.Application
    Dim oPPTPres As PowerPoint.Presentation
    Dim PresPath As String
    PresPath = "\\NTSERVER\Users\ehaidari\My Documents\Emal's Docs\DBx-V10\GOODBYE.pps"
    Set oPPTApp = CreateObject("PowerPoint.Application")

    With oPPTApp
    Set oPPTPres = .Presentations.Open(PresPath, msotristate, , msotrue)

    With oPPTPres
    With .SlideShowSettings
    .Run

    End With


    End With


    End With
    End Function

    End Function


    could you please say where I go wrong? The does everythign else except it doesnt exit after the animation.
    thanks alot.
    Last edited by Emal; 09-22-06 at 05:35.
    Emi-UK
    Love begets Love, Help Begets Help

  11. #11
    Join Date
    May 2005
    Posts
    119
    just remove the second line (Function RunPPShow_Click()) and the second "end function"

    When you're looking at your code in VBA, click on tools, references. Scroll down until you see "Microsoft powerpoint...." and click the check box to add the check.

    ~Krista

  12. #12
    Join Date
    May 2006
    Posts
    386
    Thanks Krista, It worked fine but I still have to click the last slide to exit.
    But that is better than before. Thanks again.
    Emi-UK
    Love begets Love, Help Begets Help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •