VBA files collection problem

F

fffcj

I want to get hold of a particular file which is a member of a files
colleciton of a given folder .

IN the following code , i'm in trouble on the line :
Set fil = files(lngC)

Why don't this work ??


Thanks
Chris

******************************************************


Sub EraseFirstCharsFromFileNames()



Dim fldr As Folder
Dim files As files
Dim fil As File
Dim lngFileCount As Long
Dim lngC As Long



Set fldr = mfso.GetFolder("F:\000 Samples\String Textures Time&Space
Creative EssentialsSeries\03 Cello Tremolando")


lngFileCount = fldr.files.Count



For lngC = 1 To lngFileCount


Set files = fldr.files
Set fil = files(lngC)

' mess with the file name here


Next





Set mfso = Nothing



End Sub

************************************************************
 
D

Doug Robbins

Check out the use of the Dir function.

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top