Reading "Sent Items" from a shared mailbox
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-08-22 07:42 PM
I have seen others ask this question but have not seen a response. I am able to read the inbox of a shared folder without issue (using action "get Received Items Basic") however I cannot do the same for "Sent Items" folder (using action "Get Sent Items Basic"). Getting this message (below), any ideas as to why this is happening?
Thanks You!


------------------------------
June Siravo
Analyst
FIAM
America/New_York
------------------------------
Thanks You!
------------------------------
June Siravo
Analyst
FIAM
America/New_York
------------------------------
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-08-22 01:36 PM
Hi June,
is the mailbox is default one or Shared mailbox?
if its shared then you can try the below code (you need edit the code for "sent folder")
Dim app = CreateObject("Outlook.Application")
Dim _nameSpace = app.GetNameSpace("MAPI")
Dim folder
folder = _nameSpace.Folders(MailBoxName)
If SubFolder <> "" Then
For each name as string in SubFolder.Split("\")
folder = folder.Folders(name)
Next
End If
Dim dataTable As New Data.DataTable
dataTable.Columns.Add("EntryID", Type.GetType("System.String"))
dataTable.Columns.Add("To", Type.GetType("System.String"))
dataTable.Columns.Add("CC", Type.GetType("System.String"))
dataTable.Columns.Add("Subject", Type.GetType("System.String"))
dataTable.Columns.Add("Body", Type.GetType("System.String"))
dataTable.Columns.Add("Attachments", Type.GetType("System.String"))
dataTable.Columns.Add("ReceivedOn", Type.GetType("System.DateTime"))
dataTable.Columns.Add("SentOn", Type.GetType("System.DateTime"))
dataTable.Columns.Add("SenderName", Type.GetType("System.String"))
dataTable.Columns.Add("SenderEmailAddress", Type.GetType("System.String"))
dataTable.Columns.Add("Unread", Type.GetType("System.Boolean"))
Dim folderItems = If(Filter_Expression <> "", folder.Items.Restrict(Filter_Expression), folder.Items)
For Each item As Object In folderItems
If Not TypeOf item Is MailItem Then Continue For
Dim row As Data.DataRow = dataTable.NewRow
row("EntryID") = item.EntryID
row("To") = item.To
row("CC") = item.CC
row("Subject") = item.Subject
row("Body") = item.Body
Dim attachments As String = ""
For Each attachment As Object In item.Attachments
If attachment.Type = 1 Then
attachments = attachments & "|" & attachment.DisplayName
End If
Next
row("Attachments") = If (attachments.Length = 0, "", attachments.SubString(1))
row("SentOn") = item.SentOn
row("ReceivedOn") = item.ReceivedTime
row("SenderName") = item.SenderName
row("SenderEmailAddress") = If (item.SenderEmailType = "EX",item.Sender.GetExchangeUser.PrimarySmtpAddress,item.SenderEmailAddress)
row("Unread") = item.Unread
dataTable.Rows.Add(row)
Item_Count += 1
Next
Items = dataTable
------------------------------
Hanumanth Yemmetti
Senior Developer
Shell
Asia/Kolkata
------------------------------
is the mailbox is default one or Shared mailbox?
if its shared then you can try the below code (you need edit the code for "sent folder")
Dim app = CreateObject("Outlook.Application")
Dim _nameSpace = app.GetNameSpace("MAPI")
Dim folder
folder = _nameSpace.Folders(MailBoxName)
If SubFolder <> "" Then
For each name as string in SubFolder.Split("\")
folder = folder.Folders(name)
Next
End If
Dim dataTable As New Data.DataTable
dataTable.Columns.Add("EntryID", Type.GetType("System.String"))
dataTable.Columns.Add("To", Type.GetType("System.String"))
dataTable.Columns.Add("CC", Type.GetType("System.String"))
dataTable.Columns.Add("Subject", Type.GetType("System.String"))
dataTable.Columns.Add("Body", Type.GetType("System.String"))
dataTable.Columns.Add("Attachments", Type.GetType("System.String"))
dataTable.Columns.Add("ReceivedOn", Type.GetType("System.DateTime"))
dataTable.Columns.Add("SentOn", Type.GetType("System.DateTime"))
dataTable.Columns.Add("SenderName", Type.GetType("System.String"))
dataTable.Columns.Add("SenderEmailAddress", Type.GetType("System.String"))
dataTable.Columns.Add("Unread", Type.GetType("System.Boolean"))
Dim folderItems = If(Filter_Expression <> "", folder.Items.Restrict(Filter_Expression), folder.Items)
For Each item As Object In folderItems
If Not TypeOf item Is MailItem Then Continue For
Dim row As Data.DataRow = dataTable.NewRow
row("EntryID") = item.EntryID
row("To") = item.To
row("CC") = item.CC
row("Subject") = item.Subject
row("Body") = item.Body
Dim attachments As String = ""
For Each attachment As Object In item.Attachments
If attachment.Type = 1 Then
attachments = attachments & "|" & attachment.DisplayName
End If
Next
row("Attachments") = If (attachments.Length = 0, "", attachments.SubString(1))
row("SentOn") = item.SentOn
row("ReceivedOn") = item.ReceivedTime
row("SenderName") = item.SenderName
row("SenderEmailAddress") = If (item.SenderEmailType = "EX",item.Sender.GetExchangeUser.PrimarySmtpAddress,item.SenderEmailAddress)
row("Unread") = item.Unread
dataTable.Rows.Add(row)
Item_Count += 1
Next
Items = dataTable
------------------------------
Hanumanth Yemmetti
Senior Developer
Shell
Asia/Kolkata
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-08-22 02:58 PM
Hi @June Siravo,
Can you tell me if your local instance of Outlook has the Use Cached Exchange Mode option enabled? What about the Download Shared Folders option?

In the past, we've found that both of these options can contribute to issues with accessing shared mailboxes and folders from the local Outlook instance.
Cheers,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------
Can you tell me if your local instance of Outlook has the Use Cached Exchange Mode option enabled? What about the Download Shared Folders option?
In the past, we've found that both of these options can contribute to issues with accessing shared mailboxes and folders from the local Outlook instance.
Cheers,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-08-22 09:09 PM
Hi Eric,
I tried changing the Exchange settings as you suggested, then closed and reopened Outlook but no luck, still getting the same error (see below), :

------------------------------
June Siravo
Analyst
FIAM
America/New_York
------------------------------
I tried changing the Exchange settings as you suggested, then closed and reopened Outlook but no luck, still getting the same error (see below), :
------------------------------
June Siravo
Analyst
FIAM
America/New_York
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-08-22 10:15 PM
Hi @June Siravo,
Ok, go ahead and put those settings back the way they were. I've been tinkering with the Outlook VBO today and I did notice the I've started to have some issues with accessing the Shared Mailbox on our test system. As a result, we went back and adjusted the code of the VBO a bit to basically use two different methods of trying to get a pointer to a folder (this applies to Received and Sent items as well as Shared Mailboxes).
There's a new version of the VBO (v6.10.6) on the DX now. I'd suggest grabbing the latest version and giving it a try.
Cheers,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------
Ok, go ahead and put those settings back the way they were. I've been tinkering with the Outlook VBO today and I did notice the I've started to have some issues with accessing the Shared Mailbox on our test system. As a result, we went back and adjusted the code of the VBO a bit to basically use two different methods of trying to get a pointer to a folder (this applies to Received and Sent items as well as Shared Mailboxes).
There's a new version of the VBO (v6.10.6) on the DX now. I'd suggest grabbing the latest version and giving it a try.
Cheers,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------
