Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 10th, 2005, 03:52 AM
Authorized User
 
Join Date: Nov 2005
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default Read Files from Folder using "FileSystemObject"

Say in particular foler, there are so many files, i want read each and every file one by one from specific foler, how can we do that??

 i have just read only one file by taking first file as a string and declared as a default file, code is like below:

================================================== ===============

Dim f as New Scripting.FileSystemObject
Dim file As Scripting.File
Dim folder As Scripting.Folder
Dim DefaultFile As String
Dim MyFile As String



Set Folder = f.GetFolder("C:\Temp")
DefaultFile = "somefile"
FindFile = DefaultFile & ".txt"

If f.FileExists(folder.Path & "\" & MyFile) Then

    //do something for first file
end if
================================================== ===============

  If there are 5 files in folder, then it should read one-by-one... ANY IDEAS ??

~ ~ ~ There is no Right, There is no Wrong, KNOWLEDGE is Only the POWER ~ ~ ~
__________________
~ ~ ~ There is no Right, There is no Wrong, KNOWLEDGE is Only the POWER ~ ~ ~
 
Old December 10th, 2005, 07:43 AM
Authorized User
 
Join Date: Nov 2005
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Let it be, I've fix it, using .Files property of SystemFileObject ...

~ ~ ~ There is no Right, There is no Wrong, KNOWLEDGE is Only the POWER ~ ~ ~





Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort the files in folder abhisheksud BOOK: Beginning Java 2 1 February 11th, 2007 09:49 PM
How to Zip files within a folder Udi C# 2 January 25th, 2007 12:45 AM
save files into a folder jessiang General .NET 3 January 16th, 2006 09:48 AM
FILES in FOLDER luma SQL Server DTS 0 June 9th, 2005 01:53 AM
Create/Delete files w/ASP using FileSystemObject John K. King Classic ASP Basics 3 August 17th, 2003 06:53 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.