Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello there,
I have a directory full of word docs. Each doc contains just name and address. Each doc was used to print an address label for a parcel. I need to get the name and address from each file, together with the date the file was created. This will provide a record in Excel of when each parcel was prepared for dispatch. I'm 99% sure this can be done with an Excel VBA routine, but I don't have the skill to write it myself. If anyone can help, Ill be most grateful indeed. Max |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Max,
In psuedo-code, something like: 'Make a reference to the Word type library 'in VBEToolsreferences Dim Filename As String Dim FileCount As Long Dim WordApp As word.Application Dim WordDoc As word.document filename=dir(<path to the folder & "\*.doc") Set WordApp = New word.Application With Worksheets("data").Range("a1") Do While Filename < "" FileCount = FileCount + 1 set worddoc=wordapp.documents.open(<path to the folder & "\" & filename) .offset(filecount,0)=worddoc.<name data .offset(filecount,1)=worddoc.<address data .offset(filecount,2)=filedatetime(<path to the folder & "\" & filename) WordDoc.Close Loop End With WordApp.Quit You can record a macro in Word to see the syntax of getting the name and address data. NickHK "Max Bialystock" wrote in message ... Hello there, I have a directory full of word docs. Each doc contains just name and address. Each doc was used to print an address label for a parcel. I need to get the name and address from each file, together with the date the file was created. This will provide a record in Excel of when each parcel was prepared for dispatch. I'm 99% sure this can be done with an Excel VBA routine, but I don't have the skill to write it myself. If anyone can help, Ill be most grateful indeed. Max |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel copy data | Excel Worksheet Functions | |||
How copy none excel data & paste in 2007 without overwriting data | Excel Discussion (Misc queries) | |||
Copy excel data (inc. textbox data) into Word | Excel Discussion (Misc queries) | |||
MFC - CopyFromRecordset - Copy data to Excel | Excel Programming | |||
Copy data from IE to Excel | Excel Programming |