Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2004

Tip: Looking for answers? Try searching our database.

VBA  files collection problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
fffcj - 09 Nov 2004 19:34 GMT
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

************************************************************
Doug Robbins - 12 Nov 2004 01:06 GMT
Check out the use of the Dir function.

Signature

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

>I want to get hold of a particular file which is a member of a files
> colleciton of a given folder .
[quoted text clipped - 36 lines]
>
> ************************************************************
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.