Wie starte ich denn ein Attachment mit Lotus Notes Script?
Hier ein Scriptauszug:
Set rtitem = doc.getfirstItem( "Body" )
If rtitem Is Nothing Then
Exit Sub
End If
aEmbObj = rtitem.EmbeddedObjects
strTempdir = WinTemp
If Isarray(aEmbObj) Then
Forall o In aEmbObj
strFile = o.source
o.ExtractFile( strTempdir & "\" &strFile )
strFileToOpen= strTempdir & "\" & strFile
Ret = ShellExecuteAny(GetDesktopWindow, "open", strFileToOpen, Byval 0&, Byval 0&, SW_SHOWNORMAL)
End Forall
End If
In den Declarations steht folgendes:
Declare Function ShellExecuteAny Lib "shell32.dll" Alias "ShellExecuteA" _
(Byval hwnd As Long, Byval lpOperation As String, Byval lpFile As String, _
Byval lpParameters As Any, Byval lpDirectory As Any, Byval nShowCmd As Long) _
As Long
Declare Function GetDesktopWindow& Lib "user32" ()
Const SW_SHOWNORMAL = 10
Das Attachment wird hier in das Windows-Temp-Verzeichnis gelöst, (Zeile: strTempdir = WinTemp). Die Function gibts hier im Forum unter Tipps&Tricks.