Description

class Axlsx::Hyperlink
Note:

using the hyperlink option when calling add_image on a drawing object is the recommended way to manage hyperlinks

a hyperlink object adds an action to an image when clicked so that when the image is clicked the link is fecthed.

Creates a hyperlink object parent must be a Pic for now, although I expect that other object support this tag and its cNvPr parent

Parameters:

  • parent (Pic)
  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • tooltip (String)

    message shown when hyperlinked object is hovered over with mouse.

  • tgtFrame (String)

    Target frame for opening hyperlink

  • invalidUrl (String)

    supposedly use to store the href when we know it is an invalid resource.

  • href (String)

    the target resource this hyperlink links to. This is actually stored on the relationship.

  • action (String)

    A string that can be used to perform specific actions. For excel please see this reference: msdn.microsoft.com/en-us/library/ff532419%28v=office.12%29.aspx

  • endSnd (Boolean)

    terminate any sound events when processing this link

  • history (Boolean)

    include this link in the list of visited links for the applications history.

  • highlightClick (Boolean)

    indicate that the link has already been visited.

Yields:

  • (_self)

Yield Parameters:

  • _self (Axlsx::Hyperlink)

    the object that the method was called on

An action to take when the link is clicked. The specification says “This can be used to specify a slide to be navigated to or a script of code to be run.” but in most cases you will not need to do anything with this. MS does reserve a few interesting strings. @see msdn.microsoft.com/en-us/library/ff532419%28v=office.12%29.aspx

Specifies if all sound events should be terminated when this link is clicked.

indicates that the link has already been clicked.

From the specs: Specifies whether to add this URI to the history when navigating to it. This allows for the viewing of this presentation without the storing of history information on the viewing machine. If this attribute is omitted, then a value of 1 or true is assumed.

The destination of the hyperlink stored in the drawing's relationships document.

The spec says: Specifies the URL when it has been determined by the generating application that the URL is invalid. That is the generating application can still store the URL but it is known that this URL is not correct.

What exactly that means is beyond me so if you ever use this, let me know!

The relationship object for this hyperlink.

From the specs: Specifies the target frame that is to be used when opening this hyperlink. When the hyperlink is activated this attribute is used to determine if a new window is launched for viewing or if an existing one can be used. If this attribute is omitted, than a new window is opened.

Serializes the object

Parameters:

  • str (String) (defaults to: '')

Text to show when you mouse over the hyperlink. If you do not set this, the href property will be shown.

Hyperlink is referenced in 0 repositories