Code taken from thread705-1703957, thanks strongm
That code does give me a list of Folders of the 'root', but how can I get deeper into each of these Folders to get the Sub-Folders / files in there?
---- Andy
"Hmm...they have the internet on computers now"--Homer Simpson
Code:
Option Explicit[green]
' Requires references to Microsoft Shell Controls and Automation[/green]
Public Sub Daniel()
Dim myFolderItem As FolderItem
Dim localfolder As Folder
Dim myShell As New Shell
For Each myFolderItem In ftpList("123.546.543.98/", "SomeUser", "MyPasswd") [green]'Each item could be a folder or a file[/green]
Debug.Print myFolderItem.Name, myFolderItem.IsFolder [green]' just for fun to illustrate stuff we can do[/green]
If myFolderItem.IsFolder Then[green]
'Get Sub-Folders and/or files in this folder[/green]
End If
Next
End Sub
[green]
' Returns a FolderItems collection from the FTP server[/green]
Private Function ftpList(strFTPlocation As String, Optional strUser As String, Optional strPassword As String) As FolderItems
Dim myShell As Shell
Dim strConnect As String
Set myShell = New Shell
If strUser <> "" Then strConnect = strUser & ":" & strPassword & "@"
Set ftpList = myShell.Namespace("FTP://" & strConnect & strFTPlocation).Items [green]'("ftp://user:password@ftp.site.com")[/green]
End Function
That code does give me a list of Folders of the 'root', but how can I get deeper into each of these Folders to get the Sub-Folders / files in there?
---- Andy
"Hmm...they have the internet on computers now"--Homer Simpson