View Single Post
 
Old 04-19-2012, 10:22 PM
gsrikanth gsrikanth is offline Windows XP Office XP
Competent Performer
 
Join Date: Dec 2011
Posts: 133
gsrikanth is on a distinguished road
Default FileSystemObject Compile Error: User-Defined Type Not Defined

Code:
Dim FSO As New FileSystemObject


Private Sub Command1_Click()

  Dim fld As Folder
  Dim flds As Folders
  Dim fl As File

  With FSO
    
      Set fld = .GetFolder("D:\Projects Others\TZ-HASAN\WEB\images_upload")
      Dim f
      
      'MsgBox fld.Files.Count
      
      For Each fl In fld.Files
      
        If Right(fl.Name, 3) = "img" Then
          
          fl.Name = Left(fl.Name, Len(fl.Name) - 3) & "gif"
          
        End If
      
      Next
  
  End With
  

End Sub
Reply With Quote