Link to home
Start Free TrialLog in
Avatar of cwirrgan
cwirrgan

asked on

Scheduling Outlook Application in VB

I've got a VB program which creates an instance of an Outlook application:

dim ol as outlook.application
set ol = new outlook.application

When I schedule this command using NT Scheduled Tasks, and then log out, my program hangs on the above set statement.  Is there something in the environment I needs to set which will allow outlook to initialize?  This program works fine, interactively and in batch, as long as I'm logged into NT.  Outlook doesn't have to be running either.

I've also made sure that when I scheduled the task that I used my user ID and password which has administrative priviledges.

Any help appreciated.
Avatar of neoabacus
neoabacus
Flag of United States of America image

I don't beleive that you can do this as outlook requires it to run in interactive mode.. IE: one must be logged in

this isdue to how profiles are configured in NT. when you are not logged in it does not have the correct NTuser,.dat file loaded into memory to read the mail profile in

what are you trying to accomplish via schedule??
Avatar of cwirrgan
cwirrgan

ASKER

On a daily basis I run my program, at night, to send out reports to my group.  If you know a better way to send these emails, let me know and I'll give you the points.  So far, I would agree with your current conclusion about starting outlook while logged out.
If this can be done through MAPI that would be great.  Or are we running into the same problem as we had with trying to create an Outlook session.
is it a big deal to leave the machine logged in but locked??? if you could leave the machine in this state.. things would run fine...

to lock a nt machine hit ctrl-alt-delete then hit the enter key...
I had been just locking my machine, but the System folks weren't real please with that.  I'm going with an approach that I've noticed in some of the other questions.  I'm using a Jmail class which basically allows me to send the email straight through SMTP.  

Since you were the only one who discussed the problem with me, and confirmed that I can't use Outlook when I'm not logged in, go ahead and lock the question and I'll award the points to you.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of neoabacus
neoabacus
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial