Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Mail merge with unique attachment in desktop version

I have been trying to create a workflow for mail merge with unique attachments in Power Automate Desktop. I have an excel list of email ids.  And all the files in a folder. Please help. I am new to this.


Accepted Solutions

ColumnName is the name of the column in your Excel file. You don't need all those extra variables

View solution in original post


Getting this error.


Robin.Core.ActionException: Failed to send email message ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException: Outlook does not recognize one or more names. --- End of inner exception stack trace --- at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture) at Robin.Modules.Outlook.Actions.OutlookActions.InvokeMethod(Object o, String methodName, Object[] methodArgs) at Robin.Modules.Outlook.Actions.OutlookActions.SendEmailThroughOutlook(Variant outlookInstance, Variant account, Variant from, Variant to, Variant cc, Variant bcc, Variant subject, Variant body, Variant attachments, Boolean isBodyHtml, Int32 sendEmailFrom) --- End of inner exception stack trace --- at Robin.Modules.Outlook.Actions.SendEmailThroughOutlook.Execute(ActionContext context) at Robin.Runtime.Engine.ActionRunner.RunAction(String action, Dictionary`2 inputArguments, Dictionary`2 outputArguments, IActionStatement statement)

Might be caused by the recipient address? If you get that from Excel, try to use trim before to remove whitespaces.

Regular Visitor

I don't think so. I used VBA coding for the same. It worked fine through that excel. 

Super User
Super User

PAD is not VBA 😉


This is how I extracted all my data from different columns into list such as To sent, cc, subject, document path. 

Did that. Still same. Have a look at the screenshots I posted in this comment and others. 





Super User
Super User

the error comes from the send email action

yes. I reduced my email list to just 1 line. It worked fine. There is something wrong with the way I am extracting my data from excel I guess

You are sending to a list variable, which values are separated by comma. Outlook recognizes semicolon by default.

Do you really want to send one single email to all recipients? Otherwise you need to go through every row of your columns. 



No. I dont wanna send a single email to all the recipients. I wanna send individual mail to each of them. So what should I do now?  For loop used here should do that, right?


for each in %ExcelData%


Still not working. 


It is saying Index 'Tosent' is invalid.

ToSent is my list of email ids

ColumnName is the name of the column in your Excel file. You don't need all those extra variables

View solution in original post

Worked perfectly fine. Thanks a ton🤗

New Member

Hi there, I'm new to PAD and trying to create a similar solution - email unique attachments to a list of ID's. Could you post a screenshot of your flow/automation?



Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,410)