(Solved) – Powerpoint VBA – shape hyperlink not being created

(solved)-–-powerpoint-vba-–-shape-hyperlink-not-being-created

I have the following code which I can call from within any other module:

Public Sub LinkToAddInfo(currentSlide As Long, boxName As String, addNumber As Long)

    Dim oShape As Shape
    Set oShape = ActivePresentation.Slides(currentSlide).Shapes.AddShape(msoShapeRoundedRectangle, 640, 470, 71, 27)

    With oShape
        .Fill.ForeColor.RGB = RGB(191, 191, 191)
        .Fill.Transparency = 0
        .Name = boxName

         With .ActionSettings(ppMouseClick)
            .Action = ppActionHyperlink
            .Hyperlink.SubAddress = ActivePresentation.Slides(addNumber).Name
        End With

    End With ' Shape itself

End Sub

This is meant to create a shape which links to another slide. Every part of the code works perfectly fine, except for the With .ActionSettings(ppMouseClick) part.

Why is the Hyperlink not being created?

Leave a Reply

Your email address will not be published. Required fields are marked *