Scheduled Task cant run an exe to extract messages' Attachments

Joined
Dec 9, 2007
Messages
1
Reaction score
0
Hello All,

I've developed a console application (VB.NET) that retrieves the list of unread messages to extract their attachments and save them into the file system... The app. works fine when it's double clicked.. But my problem is when creating a scheduled task on Windows Server 2000. the app. throws an error:

The server is not available. Contact your administrator if this condition persists.

Knowing that it's running as administrator account.


Dim oApp As Outlook.Application = New Outlook.Application

Dim oNS As Outlook.NameSpace = oApp.GetNamespace("mapi")

oNS.Logon("(e-mail address removed)", Missing.Value,
False, True) 'Failed
Dim oInbox As Outlook.MAPIFolder = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)

Dim oItems As Outlook.Items = oInbox.Items

oItems = oItems.Restrict("[Unread] = true")



Any help would be highly appreciated...

Regards,
Baha A. Ghanim
 

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