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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Iterate through files in a location

Status
Not open for further replies.

JohnBlaze

Technical User
Apr 5, 2002
16
0
0
US
I have code that looks at a given word document and makes some changes. How would i go through all the word documents in say my C:Data\ directory?
 
#This should get you started:
filename = Dir$("C:\Data*.doc")
'Start File Search

Do While filename <> &quot;&quot;
'this puts names on an excel worksheet but you could add them to an array and then loop thru the array
ActiveCell.Offset(r, 0) = filename
r = r + 1
filename = Dir$()
Loop Rgds
Geoff

Vah! Denuone Latine loquebar? Me ineptum. Interdum modo elabitur
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top