Click Action-related Objects¶
The following classes represent click and hover mouse actions, typically a hyperlink. Other actions such as navigating to another slide in the presentation or running a macro are also possible.
ActionSetting objects¶
-
class
pptx.action.ActionSetting[source]¶ Properties specifying how a shape or run reacts to mouse actions.
-
action¶ A member of the PP_ACTION_TYPE enumeration, such as PP_ACTION.HYPERLINK, indicating the type of action that will result when the specified shape or text is clicked or the mouse pointer is positioned over the shape during a slide show.
-
hyperlink¶ A
Hyperlinkobject representing the hyperlink action defined on this click or hover mouse event. AHyperlinkobject is always returned, even if no hyperlink or other click action is defined.
-
part¶ The package part containing this object
-
target_slide¶ A reference to the slide in this presentation that is the target of the slide jump action in this shape. Slide jump actions include PP_ACTION.FIRST_SLIDE, LAST_SLIDE, NEXT_SLIDE, PREVIOUS_SLIDE, and NAMED_SLIDE. Returns
Nonefor all other actions. In particular, the LAST_SLIDE_VIEWED action and the PLAY (start other presentation) actions are not supported.A slide object may be assigned to this property, which makes the shape an “internal hyperlink” to the assigened slide:
slide, target_slide = prs.slides[0], prs.slides[1] shape = slide.shapes[0] shape.target_slide = target_slide
Assigning
Noneremoves any slide jump action. Note that this is accomplished by removing any action present (such as a hyperlink), without first checking that it is a slide jump action.
-
Hyperlink objects¶
-
class
pptx.action.Hyperlink[source]¶ Represents a hyperlink action on a shape or text run.
-
address¶ Read/write. The URL of the hyperlink. URL can be on http, https, mailto, or file scheme; others may work. Returns
Noneif no hyperlink is defined, including when another action such as RUN_MACRO is defined on the object. AssigningNoneremoves any action defined on the object, whether it is a hyperlink action or not.
-
part¶ The package part containing this object
-