Argument ‘Attachments’: BC30512: Option Strict On disallows implicit conversions from
|‘IEnumerable(Of String)’ to ‘Attachment’. The selected value is incompatible with the property type.
can any one help me to solve these
Argument ‘Attachments’: BC30512: Option Strict On disallows implicit conversions from
|‘IEnumerable(Of String)’ to ‘Attachment’. The selected value is incompatible with the property type.
can any one help me to solve these
Save Email Attachments already saves all attachments, so looping mail.Attachments is unnecessary.
The error occurs because Save Email Attachments already processes all attachments internally.
It should not be used inside a For Each.
Remove the loop and let the activity save all attachments directly to the folder.
The Attachments (Out) property expects IEnumerable(Of Attachment), not a single attachment.
Cheers
Hey,
I guess there is a flaw in your workflow. Unlike your code, in your workflow you need to loop for each mail not mail.attachment.
For each mail you should save mail attachments that fits your rule. You can give the rule by filling Filter by filename parameter.
To sum up
Loop in mails
Fill the Filter by filename parameter in save mail attachment activity.
Save Email Attachments already handles all attachments internally, so looping through mail.Attachments causes the mismatch error.
mailfolderPath.pdf, .xlsxSo, you don’t need For Each loop.
for each
in mail.Attachments
body-> if[System.IO.Path.GetExtension(attachment.Name).ToLower() = “.pdf”]
then assign folderPath = Config("StandardFolder").ToString
save attcchement
log message("Saved PDF attachment: " & attachment.Name)
else
if[System.IO.Path.GetExtension(attachment.Name).ToLower() = ".xlsx"]
then assign folderPath = Config("CIFolder").ToString
save attachment
log medssage( "Saved Excel attachment: " & attachment.Name)
else log message("Skipped unsupported attachment: " & attachment.Name)
what about these assign folderPath = Config(“StandardFolder”).ToString as you said i have attch image of my flow
Just make sure this Assign runs before the Save Email Attachments activity.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.