Hello everyone
Basically there are word documents stored on a webpage that I would like to extract information from and put inside an excel table. I already have a code to loop through word documents of a given computer folder path to extract information from them and I want to be able to do the same thing but from a webpage. The code for extracting from a computer folder directory is as follows.
If anyone can help me to modify this code to extract the information from a webpage rather than a computer directory. It would be highly appreciated.
Basically there are word documents stored on a webpage that I would like to extract information from and put inside an excel table. I already have a code to loop through word documents of a given computer folder path to extract information from them and I want to be able to do the same thing but from a webpage. The code for extracting from a computer folder directory is as follows.
Code:
Sub extract()Dim doclist As String, sPath As String
Dim i As Integer
Set wordapp = CreateObject("Word.Application")
sPath = "path" '
doclist = Dir(sPath & "*.doc*")
i = 1
Do While doclist <> ""
Set worddoc = wordapp.documents.Open(sPath & doclist)
For Each tbl In worddoc.tables
Cells(i + 1, 1) = Trim(Right(Left(tbl.Cell(1, 2).Range.Text, Len(tbl.Cell(1, 2).Range.Text) - 1), Len(tbl.Cell(1, 2).Range.Text) - 11))
Cells(i + 1, 2) = Trim(Left(tbl.Cell(6, 2).Range.Text, Len(tbl.Cell(6, 2).Range.Text) - 1))
i = i + 1
Next tbl
worddoc.Close
Set worddoc = Nothing
doclist = Dir()
Loop
End Sub
If anyone can help me to modify this code to extract the information from a webpage rather than a computer directory. It would be highly appreciated.
Last edited: