View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
nims nims is offline
external usenet poster
 
Posts: 1
Default grabbing data from MS Word


I'm trying to create code for excel that will allow me to open a series
of word documents, copy certain rows from tables in those docs, and
paste them into the excel worksheet.

The main problem I'm having is with formatting. I am able to paste the
data in Excel, but there are characters added for spaces in the cells.

Here is my code:

Dim oWrd As Object
Set oWrd = CreateObject("Word.Application")

Dim oDoc As Object
Set oDoc = CreateObject("Word.Document")

Set oDoc = oWrd.Documents.Open("c:\OMA\TIJ_90442.doc")
'oWrd.Visible = False

ActiveWorkbook.Worksheets(1).Cells(6, 1) = oDoc.Tables(1).Rows(1)
ActiveWorkbook.Worksheets(1).Cells(5, 2) = oDoc.Tables(3).Cell(3, 5)

oWrd.Quit
Set oWrd = Nothing


--
nims
------------------------------------------------------------------------
nims's Profile: http://www.excelforum.com/member.php...o&userid=26426
View this thread: http://www.excelforum.com/showthread...hreadid=396941