I'm trying to count number of accounts present in outlook. For the first time it shows count = 0 as there is no account configured in Outlook.
Then I configure an account and tried to count the number of accounts configured within the same appliction. It shows zero every time but when I restart the application and the account is still configured then it shows 1. Strange outcome, it should show count = 1 without restarting the application.
This is my code
OutLook.Application Objoutlook = null;
OutLook.NameSpace objns = null;
OutLook.Accounts objaccounts = null;
Objoutlook = new OutLook.Application();
objns = Objoutlook.GetNamespace("MAPI");
// The Namespace Object (Session) has a collection of accounts.
objaccounts = Objoutlook.Session.Accounts;
messagebox.show (objaccounts.count);
Plz reply it's urgent
Loading
sabir HussainPosted Jul 19, 2011, 1:23 AM
I need some code to solve it
Jaganathan BantheswaranPosted Jul 18, 2011, 9:22 AM