Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export Tables from a DOC to CSV

Status
Not open for further replies.

tEkHEd

IS-IT--Management
Jan 29, 2003
261
GB
Hi there,

I have a word document that includes some table data, I want to be able to take the data from the tables and copy it to an excel sheet then save the sheet as 'exportCURRENTDATE.csv'

I would like to do this programatically as the word doc is about 1000 pages long and the data could be anywhere in the doc, so wouldn't like to trawl through the same doc every 2 weeks.

Can anyone give me a hand with this? Is it even possible to do with a macro or something? I am not sure as I don't really know VBScript that well and don't even know where to start.

Thanks in adv for any help.
 
If you are confident with the Word Object Model and the Excel Object Model you can use WSH with something like this:
Code:
Set W=WScript.CreateObject("Word.Application")
Set X=WScript.CreateObject("Excel.Application")
and then do the trick in a manner similar to VBA.

Hope This Help
PH.
 
PHV.. thanks for your reply, but I am not too sure what you mean.. Can you please elaborate?
 
I mean that if you know how to do the job in macro (VBA), then you can do almost the same things via OLE automation in VBScript within WSH. The prerequisite is that you have to know how to drive Word and Excel with VBA.

Hope This Help
PH.
 
ah ok.. now I see what you mean. No I don't currently have a macro written for this procedure, so cannot easily transfer this to VBA.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top