Read text from msg file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
18-05-20 02:11 PM
I work on msg file.
Does any one have action to read whole text directly from msg file?
I have found a solution to converet msg file to txt file and then read text from txt file. I look for shortcut.
Kind regards
------------------------------
Mateusz Wojcik
RPA Programist
Rockwell Automation
Europe/Warsaw
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
29-05-20 11:37 AM
Regards,
Pratyush
------------------------------
Pratyush Garikapati
ROM Architect
Blue Prism
Asia/Kolkata
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-06-20 03:01 PM
My case is to read msg file not email.
Kind regards
------------------------------
Mateusz Wojcik
RPA Programist
Rockwell Automation
Europe/Warsaw
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-06-20 04:49 PM
Maybe download a free program to read that file and them BP takes from there what you need.
Have a good day.
------------------------------
Luis Lopez
Customer Support Engineer English and Spanish
Blue Prism Ltd
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-06-20 04:17 AM
I misread your original query. You'll have to create a custom VBO to read a .msg file as BP doesn't have that available within its standard VBOs.
Try this and let me know if it works.
Input: File Name (text - full path and name)
Output: Items (collection)
Code:
Dim app = CreateObject("Outlook.Application")
Dim _nameSpace = app.GetNameSpace("MAPI")
'Dim item As Outlook.MailItem
Dim item as Object
item = app.CreateItemFromTemplate(File_Name)
Dim dataTable As New Data.DataTable
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"))
Dim row As Data.DataRow = dataTable.NewRow
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)
dataTable.Rows.Add(row)
Items = dataTable
------------------------------
Pratyush Garikapati
ROM Architect
Blue Prism
Asia/Kolkata
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
15-07-20 08:12 AM
------------------------------
Mateusz Wojcik
RPA Programist
Rockwell Automation
Europe/Warsaw
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
18-06-21 05:32 AM
I tried the above code and getting 1 error as follows
Stage: Code
Type: Error
Action: Validate
Description: Compiler error at line 1: 'CreateObject' is not declared. It may be inaccessible due to its protection level.
Repairable: No
------------------------------
Pramod Prasad
Consultant
EY
Asia/Kolkata
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
18-06-21 07:01 AM
I am getting below error,
------------------------------
Pramod Prasad
Consultant
EY
Asia/Kolkata
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
18-06-21 07:08 AM
Are you able to compile the code stage successfully and save the object?
Are you able to open the .msg file manually or do you get an error?
Regards,
Pratyush
------------------------------
Pratyush Garikapati
ROM Architect
Blue Prism
India
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
18-06-21 07:10 AM
Yes i am able to open the file manually , also tried in other machine i am getting same error
------------------------------
Pramod Prasad
Consultant
EY
Asia/Kolkata
------------------------------
