How to save same files name with different name?

I trying to save the email body for one particular client using “Save mail Message”. I have 20 mails from that client and I need to have separate 20 email body files but It creates just only one email body file.

My VB: “C:\Users\kmladmin\Desktop\NJIU”+mail.From.DisplayName+".MHT"

For Example the Display name is “CDS”. It creates just only one file CDS.MHT. But I need file names like CDS 1, CDS 2,… like so on till CDS 20. So that I have separate email body for every mails.

Please help me in this.

You need to add the index of the email, right?

Try these steps, inside the loop where you same all emails:

  1. Create a variable “Index” of type Int32 and with a default value of 1.
  2. Change the VB code where you assign the file name to “C:\Users\kmladmin\Desktop\NJIU”+mail.From.DisplayName + Index.ToString + “.MHT”
  3. Increment the Index using an Assign activity; Index = Index + 1.

Note: In the 2018.3 and newer versions, the For Each activity gives you access to the current index of the loop, so you don’t need steps 1 and 3 from above.


Thanks Its Working.