outlook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have some report information that is being generated using dao recordsets.
The reports read the info, output to a file, and finally emailed to the
recipients. I have completed all the above in vba code with one possible
problem that may exist.

How can I tell if outlook errors out. I can put a pause by putting the vba
code to sleep for about 5 or 10 seconds after the send command, but what can
I 'grab' as a return code from outlook - if anything ?

Thanks,
Jason
 
I have some report information that is being generated using dao recordsets.
The reports read the info, output to a file, and finally emailed to the
recipients. I have completed all the above in vba code with one possible
problem that may exist.

How can I tell if outlook errors out. I can put a pause by putting the vba
code to sleep for about 5 or 10 seconds after the send command, but what can
I 'grab' as a return code from outlook - if anything ?

Thanks,
Jason

Set up the mail routine as a function, not a sub. Then return the
error code to the value of the function.

Function SendEMail(arg1, arg2,...) As Long
On Error Goto ErrHandler

dim lngError as Long

lngError=0
'---put your e-mail code here...

Exit Function

ErrHandler:
lngError=Err.Number

End Function

Then success=(Error.Number=0)

that help?
 
Back
Top