I have been using the shell folder object to copy files from a local folder to a remote one using ftp and the CopyHere method. However, I would like to be able to remove certain files from the remote folder first. The closest I have come is the code below but the InvokeVerb ("delete") line triggers a confirmation prompt which I don't want. Is there another way of doing this?
Code:
Dim FtpFolder As Folder, LocFolder As Folder, myShell As Shell
Set myShell = New Shell
Set LocFolder = myShell.NameSpace(LocPath)
Set FtpFolder = myShell.NameSpace(FtpPath)
Dim FilItm As FolderItem
For Each FilItm In FtpFolder.Items
MsgBox FilItm.Name
FilItm.InvokeVerb "delete"
Next
FtpFolder.CopyHere LocFolder.Items, FOF_NOCONFIRMATION
Set FtpFolder = Nothing
Set myShell = Nothing