Hi All,
i have a shared mailbox in which i am running the below script to move the incoming messages to subfolder in round robin style.can we achive this using microsoft flow ? or any other way to automate it in background,
thanks ,
Dim i As Long
Private WithEvents olInboxItems As Items
Private Sub Application_Startup()
Dim objNS As NameSpace
Set objNS = Application.Session
Set olInboxItems = objNS.GetDefaultFolder(olFolderInbox).Items
Set objNS = Nothing
End Sub
Private Sub olInboxItems_ItemAdd(ByVal Item As Object)
Dim objDestFolder As Outlook.MAPIFolder
Dim moveFolder As String
If Item.Class = olMail Then
Select Case i
Case 0
moveFolder = "Folder01"
Case 1
moveFolder = "Folder02"
Case 2
moveFolder = "Folder03"
Case 3
moveFolder = "Folder04"
Case 4
moveFolder = "Folder05"
End Select
Set objDestFolder = Session.GetDefaultFolder(olFolderInbox).Folders(moveFolder)
Item.move objDestFolder
End If
Err.Clear
i = i + 1
Debug.Print i
If i = 5 Then i = 0
Set objDestFolder = Nothing
End Sub
Hi @jaleefpk,
By using Round-robin style, do you mean that you want to choose all elements in a group, usually from the top to the bottom of a list and then starting again at the top of the list and so on?
There is no direct way could be used to achieve it, while if you are familiar with Custom API, please try integrating Custom APIs with flow. The following docs for your reference:
https://docs.microsoft.com/en-us/flow/developer/register-custom-api
By the way, we could also consider using Switch cases if you don’t have too many folders.
A simple flow likes below for your reference.
Best regards,
Mabel
Hi @v-yamao-msft ,
we have centralized mailbox in which we receive emails from cutomer ,and i have 7 agents to check emails and enter order to our ERP.
i want to distribute the incoming emails regardless of sender or subject to agents equally .
Hi @jaleefpk,
Thanks for updating.
It seems that you would like to dispatch the incoming emails to 7 agents regardless of send or subject equally.
I am afraid that it could not be achieved by using OOB flow actions directly.
Best regards,
Mabel
I like this workaround! I also have the same usecase - creating a round-robin distribution - and would like to achieve it through flow. Please let us know if you create a way to do it.
Have a look at https://ivasoft.com/roudrobinsharedflow.shtml