public static IEFolder OpenFolder(IEFolders folders, int index) { try { return(folders.OpenFolder(index)); } catch (COMException exception) { if (exception.ErrorCode == (unchecked ((int)0x8004060E)) || exception.ErrorCode == MapiError.MAPI_E_NETWORK_ERROR || exception.ErrorCode == MapiError.MAPI_E_FAILONEPROVIDER) //Folder is in offline mode or Network error { OutlookSession.ProblemWithOpeningFolder(folders.GetEntryId(index)); return(null); } if (exception.ErrorCode == MapiError.MAPI_E_EXTENDED_ERROR) { OutlookSession.ProblemWithOpeningFolder(folders.GetEntryId(index)); return(null); } throw exception; } }