"how to read mail message(.msg Files) saved in an folder"

Hi ,

How to read (.msg) files from folder. can anyone please help on this!


@praneethpeyyeti Check below thread

after running it its throwing error you dont have access to run it.

Anyone can help on this…


was going through similar situation and found this thread,


Hi, I also encounter below error when I was trying to place the vbs into a notepad and try to run it. My goal is to read a .msg file in a folder then extact the subject and place it in an email. But I can’t even read the .msg at the moment… please help

error for vbs vbs script

Just delete signs: " and click it by keyboard and it should work :slight_smile:

BTW I tried with this one:

Dim OlApp
Dim Eml
Dim Arg
Set Arg = WScript.Arguments
Dim File

File = Arg(0)
Sciezka = Arg(1)

Set OlApp = CreateObject(“Outlook.Application”)
Set Eml = OlApp.CreateItemFromTemplate(File)

Sub Download(objEml)
For Each Attch In objEml.Attachments
Attch.SaveAsFile Sciezka&Attch.FileName
End Sub

And when i pass 2 arguments (first for msg file, second for directory to save attachments) it works as well :slight_smile:
I used Invoke VBScript activity.

Do you have a sample file?

Hi Praneeth,

I’m looking for a similar solution. If you have achieved it can you help out on it.

Thanks & Regards,

Use Invoke Code and pass arguments

1 Like

I am trying to use this script but it is not working for me, i haven’t changed anything you have used in the script except input argument names.

this worked, thank you!