Navigation

  • index
  • modules |
  • next |
  • previous |
  • python-pptx 0.6.18 documentation »

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 Hyperlink object representing the hyperlink action defined on this click or hover mouse event. A Hyperlink object 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 None for 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 None removes 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 None if no hyperlink is defined, including when another action such as RUN_MACRO is defined on the object. Assigning None removes any action defined on the object, whether it is a hyperlink action or not.

part¶

The package part containing this object

Table of Contents

  • Click Action-related Objects
    • ActionSetting objects
    • Hyperlink objects

Previous topic

Text-related objects

Next topic

DrawingML objects

Useful Links

  • python-pptx @ GitHub
  • python-pptx @ PyPI
  • Issue Tracker

Quick search

Navigation

  • index
  • modules |
  • next |
  • previous |
  • python-pptx 0.6.18 documentation »
© Copyright 2012, 2013, Steve Canny. Created using Sphinx 1.8.5.
Theme based on Read The Docs