Moving Email from Shared Inbox to nested subfolders


New Member
Hi ,

Am looking for a functionality : To move my current email from shared Inbox to the nested subfolder . Here based on region name I need to move email (from Inbox) to the respective RegionName folder(RegionName2) .

Hierarchy is


Any leads or help is much appreciated . Thank You .


Active Member
Hello Anjali,

if you are working with the MS Outlook VBO then ,
You need to Design code stage to move mail from one folder to another sub folder.
1.Find your desired mail that you want to move.
2. Obtain Sub folder object.
3.use mailObject.Move(SubfolderObject) to move mail from one folder to another sub folder.

I hope it will help you.,


New Member
Does this mean for a hierarchy , I will have to move to subfolder and from there to another subfolder .
In the attached screenshot from my Inbox I need to move email to folder "Documents" . But with mailObject.Move(SubfolderObject) I can only move my mails from Inbox to BBH , not to Documents.
Based on business rules I need to move mails from Parent (Inbox) to various Sub-Subfolder (nested )


  • Sub-folder.JPG
    12.7 KB · Views: 138


New Member
Hello anjali,
Did you find an answer ? If not, maybe you could try "Subfolder A\Subfolder B\Subfolder C"

There is a description in the "MS Outlook Email VBO", action "Move Email to inbox sub folder" :
"Destination Folder : Any alphanumeric value valid. The Subfolder in the Inbox, eg. Subfolder A needs to be declared as "Subfolder A". A Nested Subfolder eg. Subfolder B in Subfolder A, needs to be declared as "Subfolder A\Subfolder B".

best regards,


New Member
I tried using Subfolder A\Subfolder B , it does break the folder and get into Subfolder B , but while using item.Move (folder ) , it gives an error


  • MoveEmail.JPG
    73.7 KB · Views: 94


New Member
Mailaddress of the shared Mailbox:
Name of the Mailaccount: Shared Mail (sometimes this can also be the mail address)


Shared Mail (<-- Name of the Shared Mailbox)
->Deleted Items
----->First Folder
----->Second Folder


Dim app = CreateObject("Outlook.Application")
Dim _nameSpace = app.GetNameSpace("MAPI")
Dim Store_ID As String

Dim mailbox = _nameSpace

Dim vRecipient = _nameSpace.CreateRecipient(SharedMail)
Dim folder = _nameSpace.GetSharedDefaultFolder(vRecipient, 6)
Store_ID = folder.StoreID
Dim item = _nameSpace.GetItemFromID(Entry_ID, Store_ID)

If Destination_Folder <> "" Then
For each name as string in Destination_Folder.Split("\")
mailbox = mailbox.Folders(name)
End if

New_Entry_ID = item.Move(mailbox).EntryID


Inputs are:
Entry_ID: ID from the mail which has to be moved
Destination_Folder: Shared Mail\Folder\First Folder
Last edited:


New Member
Hi anjali,
Please change the following lines:

5 Dim mailbox= _nameSpace (you need a capital „S“ and also a capital „D“ in Dim?)
11 is your Input „Outlook_Folder_ID“ set to 6? (6 is for Inbox)
21 this line is required, comment it in
25 in the bracket insert name instead of Destination_Folder -> .…=item.Move(name)....

And I never used the MsgBox function, so I don’t know if this can also cause problems. Maybe delete this lines.

I think you commented out 21 because it was not working due to the mistake in line 5. So adjust line 5, comment in line 21 and also adjust line 25

Please let me know, if this solved your problem.

PS.: Moving the Mail will sometimes result in the mail is only moved locally on the bot without syncing it to the exchange server. So other users won’t notice that the mail was moved. You can either solve this problem by triggering a sync after moving the mail or the better solution is to simply turn off “download shared folder” in outlook.

View attachment 1409540A-5161-4405-93AD-DCB357FB6C4C.jpeg


New Member
Hello Anjali,

Were you able to fix this issue? If yes, could you please let us know what change is to be done?

Last edited:

Satya Manohar

New Member
Hi Anjali/ dhanesh,

Are you able to find any solution for this. I am also facing the issue. Not able to move mails from nested sub folders