move mails from inbox to subfolder(there are 5 subfolders under inbox for example).
For each mail after moving to subfolder the excel file should get update with assigned count for the specific sub folder.
4.As mentioned above all mails from inbox should move to all subfolders equally(if inbox has 16 mails first subfolder should get 6 and remaining 4 folders should get 5 and for next assignment should start from second subfolder as first subfolder already have 1 extra)
condition is the subfolder with less count should get assigned first.
This is the second topic you have created @Suresh_Kappa, but I dont find any answers for that topic
For your requirement,
read the mails and get the count
Use while condition to loop through all the mails and provide the condition as the count you got above
Inside that, use switch statement to move the first loop to first sub folder, second mail to second sub folder and so on, (for this initialize a variable with a value 1, and increment it everytime to help you out in the switch case.) When the loop comes to fifth sub folder, assign the variable with value 1 again so that for next loop, it will move the mail to first sub folder
I’m missing a condition there which is, assign the lowest count sub folder first. I’m just trying to find a new way for that, I will post if I did that, as I have mentioned very easy steps above, please try to build on your own @Suresh_Kappa
The problem is always it is moving first mail to first subfolder under inbox.
if it can read subfolder count and identify the subfolder with least count and move the mail first then my problem will get resolve.
Kindly try the below options and let me know if it works for your requirement with the same code.
Create 3 folders (A,B,C) under Inbox.
Keep the count of mails in folder A=3, B=2, C=3 and have one unread mail in Inbox. Then run the bot, it will move the mail to B folder only.
Logic written to distribute the Inbox mails equally to all the sub folders whenever you run the bot. Please correct if your requirement is different from the above.