Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To get the name of your items Run Macro settings, you'll run something like this:</p> <pre><code>Sub ActionSettingName() Dim p As Presentation Set p = ActivePresentation Dim s As Slide Dim sh As Shape Dim macroName As String For Each s In p.Slides For Each sh In s.Shapes If sh.Type = msoGroup Then Dim gs As Shape For Each gs In sh.GroupItems PrintMacroName gs Next Else PrintMacroName sh End If Next Next End Sub Sub PrintMacroName(sh As Shape) If sh.ActionSettings(ppMouseClick).Action = ppActionRunMacro Then macroName = sh.ActionSettings(ppMouseClick).Run Debug.Print macroName End If End Sub </code></pre> <p><strong>UPDATE:</strong> To get ActionSettings for TextRanges, please find below:</p> <pre><code>Sub ActionSettingName() Dim p As Presentation Set p = ActivePresentation Dim s As Slide Dim sh As Shape For Each s In p.Slides For Each sh In s.Shapes Dim tr As TextRange Set tr = sh.TextFrame.TextRange Dim macroName As String For i = 1 To tr.Runs.Count macroName = tr.Runs(i).ActionSettings(ppMouseClick).Run If Len(macroName) &gt; 0 Then Dim runText As String runText = tr.Runs(i).Text Debug.Print "RUN: " &amp; runText &amp; vbCrLf &amp; "MACRO: " &amp; macroName End If Next Next Next End Sub </code></pre> <p>Then you'll want to search for and extract that macro (and anything else you need) from the VBE inside the last For/Next loop.</p> <p>There are a <a href="https://stackoverflow.com/search?q=vbproject%20vbcomponents">few references on SO</a> on how to extract all macros in Excel/Word and work with the VBProject model - the techniques are identical to PowerPoint. See <a href="https://stackoverflow.com/questions/49724/programmatically-extract-macro-vba-code-from-word-2007-docs">Programmatically extract macro (VBA) code from Word 2007 docs</a> for one of the better examples. A much more comprehensive intro to the VBProject object model exists at <a href="http://www.cpearson.com/excel/vbe.aspx" rel="nofollow noreferrer">Programming The VBA Editor</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload