I have an Outlook macro for creating reply to messages. I will allow users to include up to 5 attachments. I want to allow the users to modify the part of the vba which has the names of the attachment files which are stored at C:\EmailMsg.
So the users would provide the file names like this:
strAttach1 = "ExpenseReports.pdf"
strAttach2 = "AccountPayableReport.pdf"
strAttach3 = ""
strAttach4 = ""
strAttach5 = ""
But I want to loop while i'm adding the attachments. Something like this:
For x = 1 To 5
objMail.Attachments.Add ("C:\EmailMsg\" & strAttach & x)
Next x
As I'm sure you know, this results are this this when I debug.print:
C:\EmailMsg\strAttach1
C:\EmailMsg\strAttach2
C:\EmailMsg\strAttach3
C:\EmailMsg\strAttach4
C:\EmailMsg\strAttach5
Instead of:
C:\EmailMsg\ExpenseReports.pdf
C:\EmailMsg\AccountPayableReport.pdf
C:\EmailMsg\
C:\EmailMsg\
C:\EmailMsg\
Any suggestions