Verification of Working Hyperlink

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • satifali
    New Member
    • May 2014
    • 11

    Verification of Working Hyperlink

    Hi all,

    Is there a way to verify if the hyperlink stored in table is still working or is now broken for some reason i.e. file moved / renamed etc.
  • jforbes
    Recognized Expert Top Contributor
    • Aug 2014
    • 1107

    #2
    This might be what you are after, http://allenbrowne.com/func-11.html:
    Code:
    Function fileExists(ByVal strFile As String, Optional bFindFolders As Boolean = False) As Boolean
        'Purpose:   Return True if the file exists, even if it is hidden.
        'Arguments: strFile: File name to look for. Current directory searched if no path included.
        '           bFindFolders. If strFile is a folder, FileExists() returns False unless this argument is True.
        'Note:      Does not look inside subdirectories for the file.
        'Author:    Allen Browne. http://allenbrowne.com June, 2006.
        Dim lngAttributes As Long
    
        'Include read-only files, hidden files, system files.
        lngAttributes = (vbReadOnly Or vbHidden Or vbSystem)
    
        If bFindFolders Then
            lngAttributes = (lngAttributes Or vbDirectory) 'Include folders as well.
        Else
            'Strip any trailing slash, so Dir does not look inside the folder.
            Do While Right$(strFile, 1) = "\"
                strFile = Left$(strFile, Len(strFile) - 1)
            Loop
        End If
    
        'If Dir() returns something, the file exists.
        On Error Resume Next
        fileExists = (Len(Dir(strFile, lngAttributes)) > 0)
    End Function

    Comment

    • satifali
      New Member
      • May 2014
      • 11

      #3
      Hi,
      In-fact I have a table with aprx 50K records having hyperlink in a field called (HL). I am trying verify if given hyperlink is still working or might be file has been moved / renamed etc.

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        There's already a solution posted in the thread that answers your question. Did you have another question?

        Comment

        Working...