I'm very new to C# development.
I'm trying to check and create a folder/ sub-folder exist in Outlook Mailbox using Exchange Web Service.

Folder Structure

* MAIN\_folder
* Sub Folder-1
* Sub Folder-2
* Sub Folder-3

Implementation

```
public void checkFolderExistOrNot( String folder_name)
        {
            FolderView fv = new FolderView(100);

            var findFoldersResults = exchangeService.FindFolders(
                WellKnownFolderName.Inbox,
                new SearchFilter.SearchFilterCollection(
                    LogicalOperator.Or,
                    new SearchFilter.ContainsSubstring(FolderSchema.DisplayName, folder_name)),
                fv);

            foreach (var folder in findFoldersResults)
            {
                if (folder is Folder)
                {
                    if (folder.DisplayName == folder_name)
                    {
                        archiveFolderID = folder.Id;
                    }

                }
            }
            //if archive folder not found create and assign the variable to the folderID
            if (archiveFolderID == null)
            {
                Folder folder = new Folder(exchangeService);
                folder.DisplayName = folder_name;
                folder.Save(WellKnownFolderName.Inbox);
                archiveFolderID = folder.Id;
            }

        }

checkFolderExistOrNot(MAIN_folder)
checkFolderExistOrNot(MAIN_folder.Sub Folder-1)
checkFolderExistOrNot(MAIN_folder.Sub Folder-2)
checkFolderExistOrNot(MAIN_folder.Sub Folder-3)

```

But this is only creating the Main folder under the inbox. It would be greatly appreciated if someone could help me to identify what is missing in my implementation.

Thanks in Advance.