PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → [WD22] MsgReader to read .msg files
[WD22] MsgReader to read .msg files
Débuté par Stefan Bentvelsen, 16 juin 2017 15:41 - 5 réponses
Posté le 16 juin 2017 - 15:41
Hi all,

I would like to get data from .msg-files on disk without the use of Outlook.
I found an open source .NET library MsgReader, but cannot get it to work.
I'm also not known with the use of this kind of libraries.
Is there someone who has a wordking example of the use of this library?

I've tried this:

pclMsgObj is MsgReader.Outlook.Storage.Message("RE Request for data (335 kB).msg","") dynamic sSender is string sSubject is string sBodyHTML is string sBodyText is string sSender = pclMsgObj.Sender sSubject = pclMsgObj.Subject sBodyHTML = pclMsgObj.BodyHtml sBodyText = pclMsgObj.BodyText
but it gives an error at runtime:

Error at line 11 of Click BTN_NoName1 process.
Dynamic .NET object ('pclMsgObj') not allocated.
Posté le 16 juin 2017 - 15:57
Hi Stefan,

in your code, you are saying that pclMsgObj is DYNAMIC...

that implies that after that (and depending of the documentation of the .net assembly), you will have to either instantiate it (new) or get it back from the assembly via a method made for that.

Currently, you are defining the type of pclMsgObj, but are not creating the object.

Best regards
Posté le 16 juin 2017 - 16:30
Stefan,

you need something like this

pclMsgObj is MsgReader.Outlook.Storage.Message dynamic
pclMsgObj = new MsgReader.Outlook.Storage.Message("RE Request for data (335 kB).msg","")
Posté le 16 juin 2017 - 20:35
Hi Fabrice, Arie,

when I declare the object like:

lusMessage is UNICODE string = "RE Request for data (335 kB).msg" //pclMsgObj is MsgReader.Outlook.Storage.Message(lusMessage,1) //dynamic pclMsgObj is MsgReader.Outlook.Storage.Message dynamic pclMsgObj = new MsgReader.Outlook.Storage.Message(lusMessage)
I get an error:
Error:Syntax error on ..
WIN_MsgReaderTEst.BTN_NoName1, Click WIN_MsgReaderTEst.BTN_NoName1, line 5, column 34

on the point between 'Outlook' and 'Storage' of the second line (pclMsgObj = new MsgReader.Outlook.Storage.Message(lusMessage)). Same case when I use de literal direct instead of the unicode string.
Membre enregistré
1 message
Posté le 18 décembre 2018 - 05:42
Are you hunt for a answer to ambit, register, and country MSG file acceptance without Microsoft outlook? then Download Inexact MSG Viewer Tool for Windows. This Loose outlook MSG Viewer Way for Microsoft Windows allows you to have substance around MSG files freely. It can easily scope, Show, and Lawless quadruple MSG files in the software port. The Tool is individual for a forensic group to canvass outlook Emails mail without installment Undetermined MSG Files without any plugins and confirming agency demand. But, before we inform much benefits of our MSG Viewer Means lets analyzing few users queries archetypical.

More Info :- http://www.freeviewer.net/msg
Posté le 05 octobre 2019 - 11:49
Hi Stefan,
you may want to consider commercial APIs that cost but also offer many features and support.
In my work I used library from Independentsoft company and I hope it will be helpful to you too.
It is Microsoft Outlook .msg file API for Java/Android/.NET Framework and it will be soon for Python, JavaScript, Node.js and other runtimes and frameworks based on JavaScript. / .NET Core.
The API offers Outlook functionality and there are a number of use cases on the site like:
- create message, appointment, task, contact or any other Outlook item,
- Read any Outlook .msg file and get all properties,
- Add attachments,
Retreive attachments, and much more.