Solved

Scheduling Outlook Application in VB

Posted on 2000-03-06
6
249 Views
Last Modified: 2010-05-02
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.
0
Comment
Question by:cwirrgan
  • 3
  • 3
6 Comments
 

Expert Comment

by:neoabacus
Comment Utility
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??
0
 

Author Comment

by:cwirrgan
Comment Utility
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.
0
 

Author Comment

by:cwirrgan
Comment Utility
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.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Expert Comment

by:neoabacus
Comment Utility
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...
0
 

Author Comment

by:cwirrgan
Comment Utility
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.
0
 

Accepted Solution

by:
neoabacus earned 100 total points
Comment Utility
NP sorry i couldn't be of more help..

see above text.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now