Share via

VBA code for hyperlinking slides present within the 'slide collection'

Anonymous
2023-10-29T09:26:06+00:00

I have created a VBA code for PowerPoint. It creates many slides and slide collections. Among them, I added 163 slides into new collection named "thirdCollection". Now I want to create 2 shapes in each slide present only in "thirdCollection". One shape acts as next slide button and another slide acts as previous slide button by enabling hyperlinks in them. All these hyperlinks want to work within that particular collection, and it shouldn't interefere or disturb other slides or collection in the presentation. Please give me idea of code snippet to establish this feature. (Manual hyperlink links to next slide present in the order of slides but I want it to link to next slide present within that collection.)

Microsoft 365 and Office | PowerPoint | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Anonymous
    2023-11-04T14:40:20+00:00

    thanks

    Was this answer helpful?

    0 comments No comments
  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Steve Rindsberg 99,166 Reputation points MVP Volunteer Moderator
    2023-10-29T21:51:45+00:00

    Please ignore all suggestions that urge you to take VBA questions to the Q&A forum. Unless you enjoy wasting your time.

    Here's a snippet you can adapt to what you're doing; instead of iterating through the entire .Slides collection, you'll want to iterate through the collection you've defined.

    Sub thing() ' Because I'm too lazy to give it a kewl name! 
    
        Dim oSl As Slide 
    
        For Each oSl In ActivePresentation.Slides 
    
        With oSl 
            ' And being lazy, I'll simply add the pre-defined shapes that
            ' already include the hyperlinks to next/previous slides
    
            .Shapes.AddShape msoShapeActionButtonForwardorNext, 0, 0, 100, 100 
    
            .Shapes.AddShape msoShapeActionButtonBackorPrevious, 200, 0, 100, 100 
    
        End With 
    
        Next 
    
    End Sub
    

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2023-10-29T18:55:20+00:00

    Hello SharunGi,

    Thank you for posting on the Microsoft Community Forums. I hope you are well.

    To help you better resolve your issue, we strongly recommend that you post your issue in our Microsoft Q&A forumto learn more about the resolution on your issue with the correct VBA codes. This way, the experts in these forums will be able to provide more specific information about your concern, so that you can get exactly the result you want. We want you to get exactly the information and get the result you want. Moreover, we will leave this thread open in case volunteer moderators or another community members wants to participate.

    We appreciate your understanding.

    Sincerely,

    ReynaldoB

    Microsoft Community Forum Moderator

    Was this answer helpful?

    0 comments No comments