Get file reference using File System Object

X

XP

Hi,

I need to get a reference to a text file using the file system object; here
is what I have far:

Dim oFSO As Object
Dim oFile As Object
Set oFSO = CreateObject("Scripting.FileSystemObject")


Can someone please help me out with this and post what I still need using a
generic file path/filename?

Thanks
 
X

XP

Hi,

Thanks; unfortunately our internet Nazi's have that site blocked;
is there a chance you could point me to another site or perhaps
just throw me a bone with the next line of code I need...?

Thanks so much!
 
G

Gary''s Student

First include a reference to Microsoft Scripting Runtime and then:

Sub xp()
Dim FSO As Scripting.FileSystemObject
Dim FileItem As Scripting.File
Set FSO = New Scripting.FileSystemObject
Set FileItem = FSO.Getfile("C:\test\A.ppt")
MsgBox (FileItem.Path)
MsgBox (FileItem.Size)
MsgBox (FileItem.Type)
MsgBox (FileItem.DateCreated)
Set FileItem = Nothing
Set FSO = Nothing
End Sub

If the POLICE allow, checkout:
http://msdn.microsoft.com/en-us/library/d6dw7aeh.aspx
or
http://msdn.microsoft.com/en-us/library/czxefwt8(VS.85).aspx
 

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