Open Attachments using code

S

steve

Is there any code to open attachments ? I use a code block to SAV
attachments to folders, but haven't found the code to open and vie
attachments :confused:

Stev
 
M

Michael Bauer

Am Fri, 4 Nov 2005 00:22:27 +0100 schrieb steve:

Steve, you can use ShellExecute to open files for which there´s an
application available on your computer.


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
Const SW_MAXIMIZE = 3
Const SW_MINIMIZE = 6
Const SW_NORMAL = 1

Public Sub OpenFile(sFile As String)
ShellExecute 0, "open", sFile, vbNullString, vbNullString, SW_NORMAL
End Sub
 
S

steve

Michael,
Thank you - I should've said opening MS Outlook attachments while i
Outlook - I tried pasting that code in my VB Editor, and nothin
happened..
 
Top