(Solved) – Powerpoint VBA – update tag based on frontend edits

(solved)-–-powerpoint-vba-–-update-tag-based-on-frontend-edits

I have the following code, which creates a Rounded Rectangle containing some text that acts as a hyperlink to another slide:

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

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

With oShape
    .Fill.ForeColor.RGB = RGB(191, 191, 191)
    .Fill.Transparency = 0
    .Name = boxName
    .Tags.Add "Nametag", ActivePresentation.Slides(addNumber).Name
    .Tags.Add "Caption", addName

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

    With .TextFrame.TextRange
      .Text = "Add. Info " & addDisplay & vbNewLine & addName
   End With   ' TextFrame

End With ' Square itself

End Sub

If you notice, the line .Tags.Add "Caption", addName stores the latter part of the caption.

How can I dynamically update this tag when the user manually edits the caption?

Leave a Reply

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