A
akivabrown
On Error Resume Next
'custom for each broker
'Set myItemGS = oFolder.Items.Find("[subject] = ""BH GS 29062006""")
'Set myItemHSBC = oFolder.Items.Find("[subject] = ""BH HSBC
29062006""")
'Set myItemBOA = oFolder.Items.Find("[subject] = ""BH BOA 29062006""")
Set myItemWPac = oFolder.Items.Find("[subject] = ""BH WPac
29062006""")
If Err.Number = 0 then
MsgBox(MyItemWpac & setfiledate)
Else
objErrMessage.To = "(e-mail address removed)"
objErrMessage.Subject = "No item received from WPac"
objErrMessage.Body = "File not received. Checked at "
objErrMessage.Send
Set objErrMessage = nothing
End If
'Turn back on errors
On Error GoTo 0
For some reason (maybe because i suck at programming) this is not
working, and it seems like it should. What i'm trying to do is catch
the error if the subject os not there and automate an email message to
myself . At first i tried just saying
if myItemWPac = nothing then
'send email to myself'
end if
(there was code to send the email) but i was getting an error that
myItemWPac wasn't initialized. So i went the way i had it pasted on
top. Where it shuts off the errors but then still counts the error
numbers.
If anyone can help i appreciate it greatly.
-Kevin Brown
'custom for each broker
'Set myItemGS = oFolder.Items.Find("[subject] = ""BH GS 29062006""")
'Set myItemHSBC = oFolder.Items.Find("[subject] = ""BH HSBC
29062006""")
'Set myItemBOA = oFolder.Items.Find("[subject] = ""BH BOA 29062006""")
Set myItemWPac = oFolder.Items.Find("[subject] = ""BH WPac
29062006""")
If Err.Number = 0 then
MsgBox(MyItemWpac & setfiledate)
Else
objErrMessage.To = "(e-mail address removed)"
objErrMessage.Subject = "No item received from WPac"
objErrMessage.Body = "File not received. Checked at "
objErrMessage.Send
Set objErrMessage = nothing
End If
'Turn back on errors
On Error GoTo 0
For some reason (maybe because i suck at programming) this is not
working, and it seems like it should. What i'm trying to do is catch
the error if the subject os not there and automate an email message to
myself . At first i tried just saying
if myItemWPac = nothing then
'send email to myself'
end if
(there was code to send the email) but i was getting an error that
myItemWPac wasn't initialized. So i went the way i had it pasted on
top. Where it shuts off the errors but then still counts the error
numbers.
If anyone can help i appreciate it greatly.
-Kevin Brown