Here is some food for thought.....
You could use Dir() to loop through the files in a given directory and retreive the names/paths for your transfertext.
You could also incorporate the entire thing into one procedure using the filesystemobject. Here is an example that loops through a folder and deletes the PDF files. SIDE NOTE: I use this code for files I place in there via code, so the file names don't need to be overly scrutinized within the If Then statement.
Code:
'Delete the PDF files in the temp folder
Dim strPath As String
strPath = "\\ServerName\FolderName\TempEmailFolder"
Dim fsoFile As New FileSystemObject
Dim objFolder As Folder
Dim objFile As File
Set objFolder = fsoFile.GetFolder(strPath)
For Each objFile In objFolder.Files
If InStr(objFile.Name, ".PDF") Then 'You could use Len() function to further validate
objFile.Delete True
End If
Next
Set objFolder = Nothing
'end 'Delete the PDF files in the temp folder
With objFile you could
objFile.Copy "PathToTemp.txt"
and then use the path for .txt for your transfertext.
This code would require reference to Microsoft Scripting Runtime