I am trying to get at different users inboxes programmaticall y (see code
below). It works fine, except for the fact that the logon line seems to
always logon to my local account rather than logging on to other
accounts on the network. Anybody know how to logon to other people's
accounts using this method?
//Create Outlook application
Outlook.Applica tion oApp = new Outlook.Applica tion();
//Get MAPI namespace
Outlook.NameSpa ce oNS = oApp.GetNamespa ce("mapi");
oNS.Logon("user ", "password", false, true);
//Get Messages collection of Inbox
Outlook.MAPIFol der oInbox =
oNS.GetDefaultF older(Outlook.O lDefaultFolders .olFolderInbox) ;
Outlook.Items oItems = oInbox.Items;
int intTotalNumberO fItemsInInbox = oItems.Count;
//Get unread e-mail messages
oItems = oItems.Restrict ("[Unread] = true");
int intTotalUnread = oItems.Count;
*** Sent via Developersdex http://www.developersdex.com ***