Blue Prism Outlook meeting request to collection
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-01-20 08:47 AM
Hello, I am trying to get all meeting requests that come into my outlook to go into a collection- I can use "Get Received Items" but that picks up normal mail and no meeting requests. I think it might be something to do with the code stage but not too sure what to change (the original for "Get Items" code is below). Any help appreciated, Thanks.
------------------------------
Tara McGonigle
------------------------------
------------------------------
Tara McGonigle
------------------------------
8 REPLIES 8
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-01-20 09:37 AM
unfortunately the format saved by BP site is very small, so man can't read the image and see the actual code.
Try to post the code as text in the reply snippet.
------------------------------
Cohen
RPA Developer
Romania
------------------------------
Try to post the code as text in the reply snippet.
------------------------------
Cohen
RPA Developer
Romania
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-01-20 09:46 AM
Dim app = CreateObject("Outlook.Application")
Dim _nameSpace = app.GetNameSpace("MAPI")
Dim folder = _nameSpace.GetDefaultFolder(Outlook_Folder_ID)
If Sub_Folder <> "" Then
For each name as string in Sub_Folder.Split("\")
folder = folder.Folders(name)
Next
End If
'See https://msdn.microsoft.com/en-us/library/office/aa210946(v=office.11).aspx
'for mail item properties
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
------------------------------
Tara McGonigle
------------------------------
Dim _nameSpace = app.GetNameSpace("MAPI")
Dim folder = _nameSpace.GetDefaultFolder(Outlook_Folder_ID)
If Sub_Folder <> "" Then
For each name as string in Sub_Folder.Split("\")
folder = folder.Folders(name)
Next
End If
'See https://msdn.microsoft.com/en-us/library/office/aa210946(v=office.11).aspx
'for mail item properties
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
------------------------------
Tara McGonigle
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-01-20 10:44 AM
i need to know inputs and outputs pls
------------------------------
Cohen
RPA Developer
Romania
------------------------------
------------------------------
Cohen
RPA Developer
Romania
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-01-20 11:22 AM
Inputs
Name: Data Type: Value:
Filter Expression Text [Filter Expression]
Outlook Folder ID Number [Outlook Folder ID]
Sub Folder Text [Sub Folder]
Outputs
Name: Data Type: Store In:
Items Collection Items
Item Count Number Items Count
------------------------------
Tara McGonigle
------------------------------
Name: Data Type: Value:
Filter Expression Text [Filter Expression]
Outlook Folder ID Number [Outlook Folder ID]
Sub Folder Text [Sub Folder]
Outputs
Name: Data Type: Store In:
Items Collection Items
Item Count Number Items Count
------------------------------
Tara McGonigle
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-01-20 12:32 PM
it gives me some errors. nevertheless, i would try to work with Outlook as a normal Web page, with button clicks, and insert, sending keys.
if you go to Outlook ==> File ==>Open and Export ==> Import and Export ==>Export to File ==> Next ==>CSV==>Next==>ScrollUp and Select Calendar ==>Next==>Insert PATH==>Next==>Finish==>Insert Range (1.1.2019) (2.2.2020)==>OK.
Now you have a CSV whom you can import in Collection and to stuff you need.
------------------------------
Cohen
RPA Developer
Romania
------------------------------
if you go to Outlook ==> File ==>Open and Export ==> Import and Export ==>Export to File ==> Next ==>CSV==>Next==>ScrollUp and Select Calendar ==>Next==>Insert PATH==>Next==>Finish==>Insert Range (1.1.2019) (2.2.2020)==>OK.
Now you have a CSV whom you can import in Collection and to stuff you need.
------------------------------
Cohen
RPA Developer
Romania
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-01-20 12:44 PM
Is it possible to do this via Outlook application or is the only way forward through the use of the Web app? as im needing to do this through application to get the desired result, thanks
------------------------------
Tara McGonigle
------------------------------
------------------------------
Tara McGonigle
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-01-20 07:54 PM
The above is set up to assume that each Item is also a MailItem. (Hence the line "If Not TypeOf item Is MailItem Then Continue For"). You need to check if the type is MeetingItem, and then you can go from there.
For documentation on MeetingItem and other Outlook options, check here: https://docs.microsoft.com/en-us/office/vba/api/outlook.mailitem
------------------------------
Ami Barrett
Sr Product Consultant
Blue Prism
Richardson, TX
------------------------------
For documentation on MeetingItem and other Outlook options, check here: https://docs.microsoft.com/en-us/office/vba/api/outlook.mailitem
------------------------------
Ami Barrett
Sr Product Consultant
Blue Prism
Richardson, TX
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
23-01-20 02:46 PM
I built my own Outlook Action to specifically 'Get ReportItems' (ReportItems are emails that come back as undeliverable).
My line of code which controls which item I get is
If TypeOf (SubFolderObject.Items(i)) Is Microsoft.Office.Interop.Outlook.ReportItem Then
The 'TypeOf' of a meeting item is 'MeetingItem'. So your code could be:
If TypeOf (SubFolderObject.Items(i)) Is Microsoft.Office.Interop.Outlook.MeetingItem Then
rest of code to put details into collection
------------------------------
Matt Palmer
Business Process Specialist
Chesapeake Energy
America/Chicago
------------------------------
My line of code which controls which item I get is
If TypeOf (SubFolderObject.Items(i)) Is Microsoft.Office.Interop.Outlook.ReportItem Then
The 'TypeOf' of a meeting item is 'MeetingItem'. So your code could be:
If TypeOf (SubFolderObject.Items(i)) Is Microsoft.Office.Interop.Outlook.MeetingItem Then
rest of code to put details into collection
------------------------------
Matt Palmer
Business Process Specialist
Chesapeake Energy
America/Chicago
------------------------------
