
Outlook hangs under Windows NT Task Scheduler
I have an Access application that sends email via Outlook. It works
perfectly when run from a PC on the network, or from the server when it is
run as an automatic task under the Task Scheduler. However, it only runs on
the server when I am logged into the server as Administrator at the time the
task is scheduled to run. If no one is logged into the server, the job
hangs.
I have traced the problem to the following code:
On Error GoTo fnSendEmail_Error
Set oOutl = New Outlook.Application
Set oNS = oOutl.GetNamespace("MAPI")
Set oMail = oOutl.CreateItem(olMailItem)
The job hangs on the last line. It does not trigger a jump to
fnSendEmail_Error.
Any suggestions as to the cause of the problem and how to fix it?
TIA,
--
John Green - Excel MVP
Sydney
Australia