#include Global $oOutlook = _OL_Open() Global $aItems = _OL_ItemFind($oOutlook, "*\Inbox", $olMail, "", "Subject", "Daily Process Report", "Subject", "", 1) If IsArray($aItems) Then _ArrayDisplay($aItems, "OutlookEX UDF: _OL_ItemFind - Emails with expected string in Subject") MsgBox(0, "Information", UBound($aItems)) If $aItems[0][0] = 0 Then MsgBox(16, "OutlookEX UDF: _OL_ItemPrint Example Script", "Could not find a mail item with expected Subject") Else For $i = 1 To UBound($aItems) - 1 Step 1 _OL_ItemPrint($oOutlook, $aItems[$i][0]) Next If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemPrint Example Script", "Error printing specified note. @error = " & @error) MsgBox(64, "OutlookEX UDF: _OL_ItemPrint Example Script", "Note successfully printed") EndIf Else MsgBox(48, "OutlookEX UDF: _OL_ItemFind Example Script", "Could not find an unread mail. @error = " & @error & ", @extended: " & @extended) EndIf