Share via


Follow method

Executes the specified hyperlink jump in a Pushpin balloon.

Applies to

Objects: Hyperlink

Syntax

object.Follow

Parameters

Part

Description

object

Required. An expression that returns a Hyperlink object.

Example

[Microsoft Visual Basic 6.0]
  Sub FollowHyperlink()
  Dim objApp As New MapPoint.Application
  Dim objMap As MapPoint.Map
  Dim objPin As MapPoint.Pushpin
  'Set up the application
  Set objMap = objApp.ActiveMap
  objApp.Visible = True
  objApp.UserControl = True
  'Add a Pushpin to the map
  Set objPin = objMap.AddPushpin(objMap.FindResults("Seattle, WA")(1))
  objPin.BalloonState = geoDisplayBalloon
  'Create a hyperlink for the Pushpin data set and go to that link
  objMap.DataSets(1).HyperlinkType = geoHyperlinkCalculated
  objMap.DataSets(1).HyperlinkCalculated = "https://www.microsoft.com/mappoint"
  objPin.Hyperlink.Follow
  End Sub

[C#]
void FollowHyperlink()
{
  MapPoint.ApplicationClass objApp = new MapPoint.ApplicationClass();
  MapPoint.Map objMap = null;
  MapPoint.Location objLoc = null;
  MapPoint.Pushpin objPin = null;
  object key = 1;

  //Set up the application
  objMap = objApp.ActiveMap;
  objApp.Visible = true;
  objApp.UserControl = true;


  //Get location to place Pushpin at
  objLoc = (MapPoint.Location) objMap.FindResults("Seattle, WA").get_Item(ref key);

  //Add a Pushpin to the map
  objPin = (MapPoint.Pushpin) objMap.AddPushpin(objLoc,objLoc.Name.ToString());
  objPin.BalloonState = MapPoint.GeoBalloonState.geoDisplayBalloon;

  //Create a hyperlink for the Pushpin data set and go to that link
  objMap.DataSets.get_Item(ref key).HyperlinkType = MapPoint.GeoDataSetHyperlinkType.geoHyperlinkCalculated;
  objMap.DataSets.get_Item(ref key).HyperlinkCalculated = "https://www.microsoft.com/mappoint";
  objPin.Hyperlink.Follow();
}

Note   This sample code is specifically for use in MapPoint North America; it is for illustration purposes only.