Class Hyperlink (PowerPoint VBA)

The class Hyperlink represents a hyperlink associated with a non-placeholder shape or text.

The main procedure of class Hyperlink is Delete


To use a Hyperlink class variable it first needs to be instantiated, for example

Dim hyp as Hyperlink
Set hyp = Application.Selection.Hyperlinks(Index:=1)

The following procedures can be used to set variables of type Hyperlink: ActionSetting.Hyperlink, Hyperlinks.Item, CustomLayout.Hyperlinks, Master.Hyperlinks, Slide.Hyperlinks and SlideRange.Hyperlinks


The following procedures in this class have been grouped together and are described on a separate theme page

Display/Show with its procedures ShowAndReturn and TextToDisplay


This is the main method of the Hyperlink class

Delete - Deletes the specified Hyperlink object.


Other Methods

CreateNewDocument - Creates a new Web presentation associated with the specified hyperlink.

Dim strFileName As String: strFileName = 
ActiveWindow.Selection.SlideRange(1).Hyperlinks(1).CreateNewDocument FileName:=strFileName, EditNow:=msoTrue, Overwrite:=msoTrue


Address returns or sets the Internet address (URL) to the target document.

ActivePresentation.Slides(1).Hyperlinks(1).Address = ""

EmailSubject returns or sets the text string of the hyperlink subject line. The subject line is appended to the Internet address (URL) of the hyperlink.

ActivePresentation.Slides(1).Hyperlinks(1).EmailSubject =

Parent returns the parent object for the specified object.

Dim objParent As Object
Set objParent = ActiveWindow.Selection.SlideRange(1).Hyperlinks(1).Parent

ScreenTip returns or sets the ScreenTip text of a hyperlink.

ActivePresentation.Slides(1).Hyperlinks(1).ScreenTip = "Go to the Code VBA home page"

SubAddress returns or sets the location within a document — such as a bookmark in a word document, a range in a Microsoft Office Excel worksheet, or a slide in a Microsoft PowerPoint presentation — associated with the specified hyperlink.

ActivePresentation.Slides(1).Hyperlinks(1).SubAddress =  "last quarter"

Type represents the type of hyperlink.

Dim mhtType As Office.MsoHyperlinkType
mhtType = ActivePresentation.SlideMaster.Hyperlinks(1).Type

Hyperlinks.Count returns the number of objects in the specified collection.

Dim lngCount As Long
lngCount = ActiveWindow.Selection.SlideRange(1).Hyperlinks.Count

Hyperlinks.Parent returns the parent object for the specified object.

Dim objParent As Object
Set objParent = ActiveWindow.Selection.SlideRange(1).Hyperlinks.Parent