Announcements
Hi Everyone,
In a folder, i have more than 90 pdf files to send by outlook.
I am trying to send 10 pdf in each email but i don't know how do to that.
Any idea?
thanks
This basically makes a separate attachment list for each email; best of luck!
Folder.GetFiles Folder: $'''C:''' FileFilter: $'''*''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files# should actually be set variable %Number% to %Files.Count%SET Number TO Files.Count# get the integer part, not rounded (ultimately we will need 1 more loop than this if the decimal amount is not 0Variables.TruncateNumber.GetIntegerPart Number: Number / 10 Result=> NumofEmailLoops# Get the remainder by getting the decimal place (only works when the divisor is 10)Variables.TruncateNumber.GetDecimalPart Number: Number / 10 Result=> FractionalLoop# We need the fractional number to be a whole number, so multiply by 10; this is the number of PDFs left over for the last runSET FinalPDFs TO FractionalLoop * 10# if the pdfs remaining for last run is anything but 0, add 1 to the amount of email runsIF FinalPDFs > 0 THENSET NumofEmailLoops TO NumofEmailLoops + 1END# create a list to temporarily hold the attachements that we are going to addVariables.CreateNewList List=> Attachments# this is going to hold the index of %Files% at which attachments left offSET CurrentPDF TO 0SET PDFMax TO 10# Loop 1 to Number of Email LoopsLOOP LoopIndex FROM 1 TO NumofEmailLoops STEP 1# create a list to temporarily hold the attachements that we are going to addIF LoopIndex = NumofEmailLoops THENSET PDFMax TO FinalPDFsENDLOOP AttachmentsLoop FROM 1 TO PDFMax STEP 1Variables.AddItemToList Item: Files[CurrentPDF] List: AttachmentsEND# send email here with attachmentsVariables.ClearList List: AttachmentsEND
Hi Michael,
Awesome solution!
Thank you.
I have made a modification because it was always the same file in the email (10 times the same).
I think we need to increase CurrentPDF by one in the loop which is the number of the file in the list.
You are absolutely right. I meant to put that in there and forgot. Good catch.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Jump in, show your community spirit, and win prizes!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Valantis 419
Vish WR 314
David_MA 260 Super User 2026 Season 1