Hi,
ich hab so was ähnliches mal aus dem Web gefischt. Allerdings geht's hier um Anhänge.
Aber es sollte kein Problem sein das entsprechend anzupassen. Wichtig ist hier die ShellExecute - Funktion.
Extract and start all attachments
Start one or all attachments with the appropriate file extension executable, using shell32.dll.
Code
Declare Function SleepEx Lib "kernel32" Alias "SleepEx" (Byval
dwMilliseconds As Long, Byval bAlertable As Long) As Long
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
Function ExtractAndView(Doc As NotesDocument)
On Error Goto ErrorExtractAndStartAttchments
If Doc.HASEMBEDDED = True Then
Forall eItem In Doc.ITEMS
If (eItem.Type = Clng(RICHTEXT)) Then
If Not (Isempty(eItem.EMBEDDEDOBJECTS)) Then
Forall fItem In eItem.EMBEDDEDOBJECTS
If fItem.Type = EMBED_ATTACHMENT Then
Call fItem.EXTRACTFILE( "C:\Temp" & fItem.Name)
ret = ShellExecute(handle&, "open", "C:\Temp" & fItem.Name, "", "", 1&)
xx = SleepEx (4000,0)
Doevents
'Exit Forall ' Only First attachment
End If
End Forall
End If
End If
End Forall
End If
ExitExtractAndStartAttchments:
Exit Function
ErrorExtractAndStartAttchments:
Msgbox ("in ExtractAndView: " + Error$(Err))
Resume ExitExtractAndStartAttchments
End Function
Axel