HyperlinkType Property

Microsoft Office Object Model

HyperlinkType Property

       

Sets or returns the type of hyperlink associated with the specified command bar button. Read/write MsoCommandBarButtonHyperlinkType.

MsoCommandBarButtonHyperlinkType can be one of these MsoCommandBarButtonHyperlinkType constants.
msoCommandBarButtonHyperlinkInsertPicture
msoCommandBarButtonHyperlinkNone
msoCommandBarButtonHyperlinkOpen

Example

This example checks the HyperlinkType property for the specified command bar button on the command bar named "Custom.". If HyperlinkType is set to msoCommandBarButtonHyperlinkNone, the example sets the property to msoCommandBarButtonHyperlinkOpen and sets the URL to www.microsoft.com.

Set myBar = CommandBars _
    .Add(Name:="Custom", Position:=msoBarTop, _
    Temporary:=True)
Set myButton = myBar.Controls.Add(Type:=msoControlButton)
With myButton
    .FaceId = 277
    .HyperlinkType = msoCommandBarButtonHyperlinkNone
End With
If myButton.HyperlinkType <> _
    msoCommandBarButtonHyperlinkOpen Then
    myButton.HyperlinkType = _
        msoCommandBarButtonHyperlinkOpen
    myButton.TooltipText = "www.microsoft.com"
End If