I'm trying to add multiple files when opening My Documents. I currently have a command button and when clicked the file dialog window is opened.
I am able to select as many as I can, however when it is emailed to the address it only shows 2 attachments, the first one being the form on the spreadsheet and the second being the file chosen from the file dialog window.
How can I add more than 2 attachments to my email?
I've tried using a For Loop, so there can be many attachments, however this is not working.
Please see below.
Sub SbExtra_Attachment()
'mssgbox do you have another attachment to add ?
Response = MsgBox(prompt:="Do you have any other attachments? 'Yes' or 'No'.", Buttons:=vbYesNo)
If Response = vbYes Then
Set fd = Application.FileDialog(msoFileDialogOpen)
fd.AllowMultiSelect = True
If fd.Show = -1 Then
For i = 1 To fd.SelectedItems.Count
StrFile = fd.SelectedItems(i)
Next i
End If
Else
End If
End Sub
The above currently only attaches a maximum of 2 files.
Any help would be much appreciated.
Raj
