Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default grabbing data from MS Word


I figured out how to paste the rows properly, but what is the code I
need so every row is pasted below the previous one?


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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default grabbing data from MS Word


I figured that out too! lol!

What I can't seem to do is search a directory and all subdirectories
for .doc files. I can search 1 directory, but I don't know how to
search subdirectories.


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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default grabbing data from MS Word

http://support.microsoft.com/kb/185476/EN-US/
How To Search Directories to Find or List Files

http://support.microsoft.com/kb/185601/EN-US/
HOW TO: Recursively Search Directories by Using FileSystemObject

http://support.microsoft.com/kb/186118/EN-US/
How To Use FileSystemObject with Visual Basic

--
Regards,
Tom Ogilvy


"nims" wrote in message
...

I figured that out too! lol!

What I can't seem to do is search a directory and all subdirectories
for .doc files. I can search 1 directory, but I don't know how to
search subdirectories.


--
nims
------------------------------------------------------------------------
nims's Profile:

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto-filter not grabbing all the data JerseyJ Excel Discussion (Misc queries) 2 May 14th 10 05:30 PM
Grabbing data between worksheets andrew Excel Discussion (Misc queries) 4 July 7th 08 05:39 AM
grabbing data from another website [email protected] Excel Discussion (Misc queries) 1 July 4th 08 08:26 PM
Grabbing the filtered data in a list? [email protected] Excel Worksheet Functions 3 August 23rd 06 03:33 AM
Grabbing the filtered data in a list? [email protected] Excel Worksheet Functions 0 August 22nd 06 09:59 PM


All times are GMT +1. The time now is 12:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"