create Hyperlink programmatically

How to create hyperlink and attach to an element in VBA?

Regards,

Jeffrey Kam

Parents
  • Engineering Links

    If by Hyperlink you mean an Engineering Link then it's done using tags. MicroStation uses a tag set named 'Internet' that contains tag definitions 'URL' and 'description' plus some others. MicroStation's Engineering Links tool will interpret tags created with that tag set and follow the hyperlink contained in the URL tag.

    With VBA, you create tags in the usual way using the 'Internet' tag set definition.

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • Jeffrey,

    I use datablock to embed and retrieve the hyperlink. For example;

    Private Const attrId As Long = 22352

    Sub embed_hyperlink_as_datablock(elem  as ShapeElement)

         Dim dblk As New DataBlock,sqlWeb as string

         sqlWeb="www.google.com"

         dblk.CopyString sqlWeb, True

           elem.AddUserAttributeData attrId, dblk

           elem.Rewrite

    End Sub

    To get sqlWeb string use;

    Sub get_Hyperlink_from_Datablock(elem  as ShapeElement )

    dblk = elem.GetUserAttributeData(attrId)

    dblk(0).CopyString sqlWeb, False

    End Sub

    Regards,

    Olcay Ebcin

Reply
  • Jeffrey,

    I use datablock to embed and retrieve the hyperlink. For example;

    Private Const attrId As Long = 22352

    Sub embed_hyperlink_as_datablock(elem  as ShapeElement)

         Dim dblk As New DataBlock,sqlWeb as string

         sqlWeb="www.google.com"

         dblk.CopyString sqlWeb, True

           elem.AddUserAttributeData attrId, dblk

           elem.Rewrite

    End Sub

    To get sqlWeb string use;

    Sub get_Hyperlink_from_Datablock(elem  as ShapeElement )

    dblk = elem.GetUserAttributeData(attrId)

    dblk(0).CopyString sqlWeb, False

    End Sub

    Regards,

    Olcay Ebcin

Children
No Data