Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

shell and xx.eml 1

Status
Not open for further replies.

TomSwingruber

Programmer
May 21, 2003
21
0
0
US
If you double-click on an .eml file in the windows explorer it will open in Outlook Expres email reader (Microsoft refers to it as a separate window). This is a separate window that opens, showing the message text and the attachment file names.

If you use the Shell function in VB, it just opens the default folder in Outlook Express and ignors the associated .eml file.

I need to open the designated .eml file in the so called email reader from the Shell function
and the msimn.exe application.

The standard Shell protocol used for things like MSword,
Notepad etc just does not work for me.

Note: To make an .eml file just do a "save as" of
an email in Outlook Express.

Thanks I hope.
Tom
 
Use the ShellExecute api. To use this api put the following declaration in a module:

Public Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long,
ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Then call it like this:


ShellExecute Me.hwnd, vbNullString, "C:\xx.eml", vbNullString, "C:\", 1

Put in the proper path and filename in place of "C:\xx.eml".

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
MR Jebenson
Fantastic solution!!!
I have been working for 2 days to solve this problem.
Thank you
Thank you

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top