Results 1 to 8 of 8

Thread: Jump to a slide using Macro/VB code in Powerpoint

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    4

    Question Jump to a slide using Macro/VB code in Powerpoint

    Hi,

    I'm new to VBA.
    I had a powerpoint presentation where I wish to loop it forever. However, I can't use the built-in Show Options - "Loop continously until Esc" because I wish to jump to a middle slide at the end of the slides & loop from there onwards subsequently.
    I've searched the web but can't find any answer via MS Powerpoint buildin settings.

    Was thinking if this can be done thru VB coding.
    Any help is appreciated.

    Thanks!

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Jump to a slide using Macro/VB code in Powerpoint

    Welcome to the Forums.

    What you could do is create two slideshows. One that transverses the entire slide collection and then ends. Then
    right after that you could run your second show which will consist of only the middle slide starting position to the
    ending slide.

    So if you have 10 slides you would have your first slideshow 1-10 and your second show 5-10 slides only. Then the
    second show could loop from its first slide of #5 to its last slide #10 (5, 6, 7, 8, 9, 10, 5, 6, 7, 8,9, 10, ...)
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    4

    Re: Jump to a slide using Macro/VB code in Powerpoint

    Thanks RobDog888 for the prompt reply.
    But how do I make the 2 presentation slides to run after the other? That is, how to run the 2nd slides automatically after the 1st one has ended?

    Thanks!

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Jump to a slide using Macro/VB code in Powerpoint

    If you record a macro you will see the generated code in the VBE.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    4

    Re: Jump to a slide using Macro/VB code in Powerpoint

    I don't seems to be able to run the macro automatically at the end of the 1st set of slides for it to trigger to run the 2nd set of slides.

  6. #6
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Jump to a slide using Macro/VB code in Powerpoint

    loop the second one. record a macro to play the first one and then play the second one.

  7. #7

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    4

    Re: Jump to a slide using Macro/VB code in Powerpoint

    Thanks for the reply. But where do I record the macro? In the 1st slides? I tried that, but don't know how to start the macro automatically at the end of the 1st slides to run the 2nd one.

    Basically, I have my wedding slides which shows my fiancee and mine old photos of growing up, when it finally reach the pt where we show our wedding photos (studio photos), I wish to loop this portion endless and not to start the loop from the beginning of the old photos slides.

  8. #8
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Jump to a slide using Macro/VB code in Powerpoint

    Record one macro of the first set. Then record another macro with the second set, which repeats. Then record the one that you will use, which plays the first macro, and then the second macro. The second macro will loop by default.
    The third macro will play the second macro over and over until you stop it.

Posting Permissions

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



Click Here to Expand Forum to Full Width