PDA

Click to See Complete Forum and Search --> : Open a .msg file from VBA


Granty
Oct 1st, 2004, 09:37 AM
Hey folks,

I need to open some .msg files that are sitting on a network drive into Outlook programmatically so I can use the SaveAs text and remove the formatting. Anyone know how? (All i need is the code to open the file in outlook, the rest is all done).

Cheers
J.

RobDog888
Oct 2nd, 2004, 11:23 AM
I think all you should need to do is a ShellExecute API
on each .msg file and it will open in Outlook if its your default
email program.
Private 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

Private Const SW_SHOWNORMAL As Long = 1
Private Const SW_SHOWMAXIMIZED As Long = 3
Private Const SW_SHOWMINIMIZED As Long = 2