Extract and start all attachments

Start one or all attachments with the appropriate file extension executable.

Start one or all attachments with the appropriate file extension executable, using shell32.dll.

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)
                                   'Exit Forall ' Only First attachment
						End If
					End Forall
				End If
			End If
		End Forall
	End If
	Exit Function
	Msgbox ("in ExtractAndView: " + Error$(Err))
	Resume ExitExtractAndStartAttchments
End Function

Dig Deeper on Lotus Notes Domino Administration Tools

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...