Read .msg file into microsoft outlook

Vaalen

Member
Hi,

We are using an application which stores all kinds of files as blob in the database. This includes mails as .msg file.

The user should be able to double-click the .msg file and see the contents, preferably in MS Outlook (2003).

Is this somehow possible? If so, can anyone help me with this?

I use OpenEdge 10.2A on windows XP.

Thanks in advance.​
 

Vaalen

Member
Nobody has any suggestion?
Seeing the .msg in Outlook would be fine, but if there is some viewer that does the trick, that would be fine also.
 

rzr

Member
Not sure if this helps..

Kb# p13376:

goal:
is there a way to read outlook emails from progress 4gl/abl?
fact(s) (environment):
windows
openedge 10.x

fix:
in way to be able to read outlook emails from progress 4gl/abl it is necessary to use the microsoft outlook: Integration apis. the documentation of the ms outlook integration api reference can be downloaded from the microsoft website. the microsoft office outlook 2003 integration api reference contains comprehensive documentation for different sets of apis that allow 4gl/abl and third-party developers to extend and integrate with microsoft office outlook . The documentation contains reference materials for the outlook integration apis, including the account management api, the data degradation layer api, the free/busy api, the mapi-mime conversion api, the offline state api, the replication api,
and the store api.
 

Vaalen

Member
The only thing you can do with these api's (as far as I understand) is create new mails, save mails, that sort of thing. There is no way you can offer a .msg file to outlook programmatically.
 

Casper

ProgressTalk.com Moderator
Staff member
ofcourse you can: just save it somewhere and use external procedure shellexecuteA to open it:

Code:
PROCEDURE ShellExecuteA EXTERNAL 'shell32':U :
     DEFINE INPUT  PARAMETER HWND AS LONG.
     DEFINE INPUT  PARAMETER pcOperation  AS CHARACTER.
     DEFINE INPUT  PARAMETER pcFile       AS CHARACTER.
     DEFINE INPUT  PARAMETER pcParameters AS CHARACTER.
     DEFINE INPUT  PARAMETER pcDirectory  AS CHARACTER.
     DEFINE INPUT  PARAMETER pnShowCmd    AS LONG.
     DEFINE RETURN PARAMETER pnInstance   AS LONG.
END.

and open it like this:
Code:
    RUN ShellExecuteA( INPUT  0
                     , INPUT  'OPEN':U
                     , INPUT  c_fullname
                     , INPUT  '':U
                     , INPUT  '':U
                     , INPUT  1
                     , OUTPUT i_osFout
                     ).

HTH,
Casper.
 

Vaalen

Member
Thank you Casper.

Please tell me where to find all this wisdom. I spent hours and hours searching progress manuals, internet and whatever I could think of?
 

Vaalen

Member
This is exactly what I wanted. Thank you.

Does external "shell32" just redirect whatever you want directly to windows and windows knows that .msg is meant to open outlook?
 

rzr

Member
wonderful...

i was trying ....

DEFINE VARIABLE cLaunchApp AS CHARACTER NO-UNDO.
cLaunchApp = '"C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE"'.
OS-COMMAND SILENT VALUE(cLaunchApp).

now that opend outlook.. i was cracking my head to find how to pass a parameter to above command to open a specific .msg ... simliar to what we do with prowin32.exe and -p parameter...

thanks Casper
 

Casper

ProgressTalk.com Moderator
Staff member
Does external "shell32" just redirect whatever you want directly to windows and windows knows that .msg is meant to open outlook?
yes shellexecuteA just uses the application registered in windows to open files of that extension to open it.

Does this work with Windows 7 as well? And x64-versions?
I didnt test it, but I see no reason why it shouldn't work with x64 versions too. It works in windows 7.

Regards,
Casper.
 
Top