I'm sorry, now it seems to be working. I'm not really sure what changed
Thanks anyway
Yesterday, I tried reading mail from an Inbox
subfolder of a shared mailbox after implementing the code above. I couldn't get it to work. I was also getting an error stating: "Could not execute code stage because exception thrown by code stage: The attempted operation failed. An object could not be found."
Today, I'm not trying the code again cause I know it didn't work the previous day. So I have a look at this post again, wondering if I missed something. I then notice
@drubiano has brought a slight modification to the code. So I figure it wouldn't hurt to try this out, even though I had a feeling it did pretty much the exact same thing. It worked! I was able to read from an Inbox
subfolder of a shared mailbox.
I'm really happy, thinking
@drubiano's code is what made it work. So I then proceed with making modifications to other code has I now need to move mail from a shared mailbox Inbox
subfolder to another
subfolder in that same shared mailbox. To test it out, I create a new
subfolder and proceed with it. I run the code again to read the mail, and it no longer works, while it worked a minute ago!
I notice
@drubiano above mentioned the code wasn't working for him and then suddenly, it started working and he didn't know what he changed. That lead me to wonder... Is it possible that the Microsoft Exchange Server takes time to react to subfolder structure modifications brought to a shared mailbox and that these modifications have an impact, preventing the code from being able to find these subfolders until the server refreshes?
You bet it does! If you have
Cached Exchange Mode turned on in your Outlook settings, you'll have issues with your code every time your folder structure changes, until your cache is refreshed. Turn off the Cached Exchange Mode and you'll be fine.
This is where you'll find out how to modify this setting. Of course, you need to turn it OFF, not ON like this link is telling you.
https://support.office.com/en-us/ar...nge-mode-7885af08-9a60-4ec3-850a-e221c1ed0c1c