score:0

to import from word to excel, try the following.

sub wordtoexcel()
dim wdapp as word.application
dim wddoc as word.document
dim x as integer
dim strfilename as string
dim strfolder as string
dim temp as string

set wdapp = new word.application
'initialise counter
x = 1
'search for first file in directory
strfolder = "c:\test\"
strfilename = dir(strfolder & "*.doc")
'amemd folder name
do while strfilename <> ""
set wddoc = wdapp.documents.open(strfolder & strfilename)
temp = wddoc.tables(1).cell(2, 1).range.text 'read word cell
range("a2").offset(x, 0) = temp
temp = wddoc.tables(1).cell(2, 2).range.text 'read word cell
range("a2").offset(x, 1) = temp
'etc
temp = wddoc.tables(1).cell(2, 3).range.text 'read word cell
range("a2").offset(x, 2) = temp
temp = wddoc.tables(1).cell(2, 4).range.text 'read word cell
range("a2").offset(x, 3) = temp

wddoc.close
x = x + 1
strfilename = dir
loop
wdapp.quit
set wddoc = nothing
set wdapp = nothing
end sub

Related Query

More Query from same tag