Forum Discussion
tppegu
15 years agoContributor
The SendMail function can only send a single attachment. The SendEmail (note different spelling) function listed at the URL you provided is able to send multiple attachments, but their names must be provided as a comma-separated list. You can generate a list of files in a folder using something like this (apologies if the syntax is wrong. I don't normally use VB) :
Function ListFiles(folder)
Dim oFolder, colFiles, f
Set oFolder = aqFileSystem.GetFolderInfo(folder)
Set colFiles = oFolder.Files
Set strFileList = ""
aqString.ListSeparator = ","
While colFiles.HasNext
Set f = colFiles.Next
strFileList = aqString.AddListItem(strFileList, f.Name)
Wend
ListFiles = strFileList
End Function
Function ListFiles(folder)
Dim oFolder, colFiles, f
Set oFolder = aqFileSystem.GetFolderInfo(folder)
Set colFiles = oFolder.Files
Set strFileList = ""
aqString.ListSeparator = ","
While colFiles.HasNext
Set f = colFiles.Next
strFileList = aqString.AddListItem(strFileList, f.Name)
Wend
ListFiles = strFileList
End Function
Related Content
- 7 years ago
- 13 years ago
Recent Discussions
- 18 hours ago
- 18 hours ago
- 5 days ago