Forget the "Source: PDF - 9502013412.pdf" its for my own use... so I
can know where the file the referene above links to.
What I want exactly is to get the data which you see in word
"printscreen / jpg) to be converted into excel format.
"Title" info is pasted into "column A" in excel
"Author" info is pasted into "column B" in excel
and so on..
Edit the path and file name for the Word document containing all the tables
and see if this does what you want.
Sub ScanWdTables()
Dim strTitle As String
Dim strAuthor As String
' Start Word and open document containing tables
Set oWd = CreateObject("Word.Application")
oWd.Visible = False
Set oDoc = oWd.Documents.Open("C:\Test\TestTables.doc")
' Process through each of the tables
For T = 1 To oDoc.Tables.Count
' Optain text from Word table cells
strTitle = oDoc.Tables(T).Cell(1, 2).Range.Text
strAuthor = oDoc.Tables(T).Cell(2, 2).Range.Text
' Trim End of Cell markers from text extracted
strTitle = Left(strTitle, Len(strTitle) - 2)
strAuthor = Left(strAuthor, Len(strAuthor) - 2)
' Populate Excel Cells with text from Word tables
Cells(T, 1).Value = strTitle
Cells(T, 2).Value = strAuthor
Next T
oDoc.Close
oWd.Quit
Set oWd = Nothing
End Sub
Steve
> Forget the "Source: PDF - 9502013412.pdf" its for my own use... so I
> can know where the file the referene above links to.
[quoted text clipped - 5 lines]
> "Author" info is pasted into "column B" in excel
> and so on..
I looked back at your original post and see you also wanted to extract the
document type. The code below should do the trick. Keep in mind, I've
assumed that the only tables in your Word document are like the picture you
posted and normally I'd take the time to put in error checking.
Here you go.
Sub ScanWdTables()
Dim strTitle As String
Dim strAuthor As String
Dim strType As String
' Start Word and open document containing tables
Set oWd = CreateObject("Word.Application")
oWd.Visible = False
Set oDoc = oWd.Documents.Open("C:\Test\TestTables.doc")
' Process through each of the tables
For T = 1 To oDoc.Tables.Count
' Optain text from Word table cells
strTitle = oDoc.Tables(T).Cell(1, 2).Range.Text
strAuthor = oDoc.Tables(T).Cell(2, 2).Range.Text
strType = oDoc.Tables(T).Cell(4, 2).Range.Text
' Trim End of Cell markers from text extracted
strTitle = Left(strTitle, Len(strTitle) - 2)
strAuthor = Left(strAuthor, Len(strAuthor) - 2)
strType = Left(strType, Len(strType) - 2)
' Populate Excel Cells with text from Word tables
Cells(T, 1).Value = strTitle
Cells(T, 2).Value = strAuthor
Cells(T, 3).Value = strType
Next T
oDoc.Close
oWd.Quit
Set oWd = Nothing
End Sub
Steve
> Forget the "Source: PDF - 9502013412.pdf" its for my own use... so I
> can know where the file the referene above links to.
[quoted text clipped - 5 lines]
> "Author" info is pasted into "column B" in excel
> and so on..
Ctech - 22 Jan 2006 23:23 GMT
Steve Yandl: Thank you so much.. I have to ask, is this you full time
job, helping less knowledgeable guys like me making macros?
Anyway, thank you.. You make life so much easier....

Signature
Ctech
Steve Yandl - 23 Jan 2006 15:09 GMT
You're welcome. As to your question, I'm disabled and no longer working a
regular job so I probably have more time than many people for volunteer
work. Most of the time spent in this group is reading and learning but I do
find opportunities to offer help from time to time.
Steve
> Steve Yandl: Thank you so much.. I have to ask, is this you full time
> job, helping less knowledgeable guys like me making macros?
>
> Anyway, thank you.. You make life so much easier....