I have a table of file paths and file names for closed word documents. Here is an example:

File Path File Name
Q:\filepathexample\ docexample.doc

In each of my closed documents there are 2 tables in the header. I need to extract the value of cell A1 in table 2 of the header, and paste it into my table in column C.

I would prefer to do this without opening the word document, because I may be running this code for hundreds of entries in my table.

Here's my code so far, I have defined the path and filename as strings, and the code it will loop through my table. I've had a little success with pulling data from tables in the body of the document, but I can't figure out how to access the tables in the header.

Sub wordextract()
    
Dim lRow As Integer   'current row
Dim lLR As Long         ' last row
Dim sPath As String    'file path
Dim sName As String  'file name
Dim tablenum as integer 'table number in word


lLR = Range("A" & Rows.Count).End(xlUp).row
For lRow = 1 To lLR
    sPath = Cells(lRow, "A")
    Bname = Cells(lRow, "B")
    
'this line will paste the value into the correct column and row in my worksheet, but I can't figure out how to grab that cell value from the word doc
    Range("C" & lRow & "").Value = ???
    
Next lRow

End Sub