Get All Links in a Document

后端 未结 7 1293
余生分开走
余生分开走 2020-12-01 08:33

Given a \"normal document\" in Google Docs/Drive (e.g. paragraphs, lists, tables) which contains external links scattered throughout the content, how do you compile a list o

相关标签:
7条回答
  • 2020-12-01 09:19

    This Excel macro lists the links from a Word doc. You'd need to copy your data into a Word doc first.

    Sub getLinks()
    Dim wApp As Word.Application, wDoc As Word.Document
    Dim i As Integer, r As Range
    Const filePath = "C:\test\test.docx"
    Set wApp = CreateObject("Word.Application")
    'wApp.Visible = True
    Set wDoc = wApp.Documents.Open(filePath)
    Set r = Range("A1")
    For i = 1 To wDoc.Hyperlinks.Count
        r = wDoc.Hyperlinks(i).Address
        Set r = r.Offset(1, 0)
    Next i
    wApp.Quit
    Set wDoc = Nothing
    Set wApp = Nothing
    End Sub
    
    0 讨论(0)
提交回复
热议问题