outlook

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
 
P

pietlinden

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top