deleting hyperlinks

Discussion in 'AutoCAD' started by Sean, Dec 29, 2004.

  1. Sean

    Sean Guest

    Hi all:
    I am using vba to add hyperlinks to block objects. It works great. Now, I am
    trying to make a simple button that will make a selectionset of all blocks
    and then Delete any and all hyperlinks. Here is what i have so far, but it
    is not working. Any ideas? Thanks. Sean

    Dim ss As AcadSelectionSet
    Dim intCode() As Integer
    Dim varCodeValue() As Variant
    Dim objBlock As AcadBlockReference
    Dim Hyperlinks As AcadHyperlinks
    Dim Hyperlink As AcadHyperlink

    Set ss = CreateSelectionSet
    ReDim intCode(0)
    ReDim varCodeValue(0)
    intCode(0) = 2
    varCodeValue(0) = "p-label-size"

    ss.Select acSelectionSetAll, , , intCode, varCodeValue

    For Each objBlock In ss
    On Error Resume Next
    Set Hyperlinks = objBlock.Hyperlinks
    Hyperlink.delete
    Next
     
    Sean, Dec 29, 2004
    #1
  2. Sean

    Ed Jobe Guest

    You set the Hyperlinks object but not the Hyperlink object. You have to
    iterate the Hyperlinks collection.
     
    Ed Jobe, Dec 29, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.