MVPS: Please help with Outlook.Namespace.Logon and automation

J

JM

Hello,

I'm attempting to write a VB.NET program that will be run periodically
using Ad Tempus (a scheduler). Ad Tempus will allow you to run the
VB.NET application as a particular user.

In the VB.NET application, I'm logging into Outlook using:
'objNameSpace.Logon("John Doe", "catfish", False, True)', for example.
On my test machine, it's not working well at all unless I'm already
logged into Outlook as John Doe. Also, it keeps giving me a dialog
box that says, "A program is trying to access email addresses you have
stored inOoutlook. Do you want to allow this?" with a checkbox
indicating how many minutes you want to give access.

All of this is unacceptable for an automated setup. None of the
Microsoft examples mention any of the pitfalls involving Exchange
profiles, logins, etc. My whole point in using this Outlook instance
is to automate checking/processing of a particular email box with no
human interaction. It's a given I need a mail profile on the
production server for this mailbox, but, beyond that, I think I should
be able to automate everything as long as I call the VB.NET program
from the scheduler with the correct credentials.

Thanks,

JM
 
S

Sue Mosher [MVP-Outlook]

Outlook is unsuitable for running with a scheduler in part because of the
likelihood of modal UI popping up (and not just the security prompts, which
are discussed in detail at http://www.outlookcode.com/d/sec.htm). If this is
an Exchange mailbox you're trying to check remotely, WebDAV would be a
better approach and would not trigger security prompts. (CDO 1.21 is also
sometimes recommended, but it *will* trigger security prompts.)

FWIW, the password parameter in Namespace.Logon is obsolete; omit it. The
NewSession parameter is irrelevant if Outlook is already running, since you
cannot create a new instance of Outlook running a different profile.

FYI, there is a newsgroup specifically for general Outlook programming
issues (even .NET) "down the hall" at microsoft.public.outlook.program_vba
or, via web interface, at
http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.outlook.program_vba
 

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