Hello,
I apologize, when writing the code here manually, and when trying to color and space the lines, I made typos
my code is much more extensive and I had removed some parts, along with file attachment with full code
Miguel,
Thanks Miguel, will try on these!
Can the macro modified to pick up a pdf attachment from a designated Folder eg c:Data*a.pdf, b.pdf,c.pdf d.pdf, x.pdf,y.pdf, m,pdf z.pdf etc etc etc
and email via outlook to specific recipient [ base on a Master Email address list] together with the related attachment pdf file. [ generated by System]
Hello,
yes, you just need to add the email addresses in Worksheets ("list_of_emails") in the columns ("A" & /or "B" &/or "C"),
and put all the file paths to be attached in the column ("D"), and if it is an (example) file: PDF just created,
when creating it, add the path in a column line ("D"),
and to use it all, activate the two "options 1" in the macro and disable the two "options 2"
Miguel,
Dear Miguel,
I attached the macro file with layout modified per your suggested format can you help put back the VB codes to send with pdf as attachment to related recipient.
Hello,
the file you placed, has no module, that is, only the excel sheets!
the excel file I provided in post 16 works perfectly with Outlook in 32 or 64 bits, and sends any type of file
if in column ("D") the paths of the files inserted there are incorrect, or after checking the macro,
determine that it does not exist in the indicated location,
the macro will not attach them to the Outlook message
review what you are doing wrong
I send a new attachment of the same file
do a test according to my file, before any changes, just put the email addresses in the columns ("A, B, C")
and the paths of the files to be attached in the column lines ("D" ), click the command button button in the excel spreadsheet
Miguel,
Thanks will try
We almost there
But what I need is each attachment file from the source folder goes to specific email recipient.
but the macro seems send all attachment from the folder to all recipient simultaneously, pls help to modify the attach
My meaning as follows :
Receiver | Should get ONLY |
[email protected] | RA_HN0B_1120.pdf as attachment ONLY |
[email protected] | RA_HN0F_1120.pdf as attachment ONLY |
[email protected] | RA_HN0M_1120.pdf attachment ONLY |
[email protected] | RA_HN0P_1120.pdf attachment ONLY |
[email protected] | RA_HN0T_1120.pdf attachment ONLY |
Hello,
new macro was made to send email through Outlook the macro will analyze each line of the sheet where the mailing lists are email will be sent to each recipient on each line only files that are on the corresponding line will be attached to the recipient of each line if you want to add more than one attachment to the same email, you just have to follow the example I left it ... that is, you have to write as follows in column ("D"), in the recipient's row: file1 path#file2 path#file3 path C:Users...image1.jpg#C:Users...notepad.txt#C:Users...pdf file.pdf if it's just an email it's just: C:Users...pdf file.pdf
in short, each line is an email with its attachments
Miguel,
Hello,
I changed the attachment line in this attachment, for each email line to be sent, the attachments will be from column ("D") to column ("J") of the same line
now the choice is yours, the attachment of post 23 or 24
Miguel,
Thanks so much Miguelthe modifications.Will try on that with live samples this week.
Thanks again Miguel
I try the macro with live data but found that attached has been attached twice for each mail send, [ pls refer attached screen shot] can you help again to rectify the script.
Also is it possible to add the "To Email recipient" from one to five "CC Email recipient from one to five'" ;"BCC Email recipient from one to five'"
Hello,
sorry, my mistake
change in module1 where the following part is, replace the line with this one in red
If x > 0 Then
For a = LBound(ArrInput) To UBound(ArrInput) - 1
ArrOutput = Split((ArrInput(a)), "#")
On Error Resume Next
checkD = ArrOutput(0)
On Error GoTo 0
If checkD <> "" Then
If FileExist(checkD) = False Then GoTo nextX:
outlEmail.Attachments.Add checkD
End If
nextX:
attached corrected file
Miguel,
Thanks millions! Miguel. I did try with live data again, and found perfectly workout.
However ask a bit more can we increase the number of recipient to 5 for each recipient category i.e 5 To : 5 CC: 5 BCC:
Hello,
update complete, file attached
you just need to do the following when you go to write the email addresses, whether in column ("A") send to, or in column ("B") send CC, or in column ("C") send BCC, insert a semicolon ";" between each email address example in range ("A2"): [email protected];[email protected];[email protected]
for ranges in columns ("B") and ("C") it is the same situation
Miguel,
Really, thanks Miguel, appreciate your great help, also thanks the Forum providing such lovely place to master Excel skills
Will try on that.