Fix Outlook folder discovery to find all contact folders

- Scan all stores recursively instead of only the default folder
- Properly release COM objects to avoid leaks
- Better error handling with debug output per store/folder
- Show error message if Outlook is not reachable
- Fallback to default contacts folder if recursive scan finds nothing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-03 11:52:44 +02:00
parent d0a2ffc9fd
commit 9298c3c287
2 changed files with 45 additions and 29 deletions
@@ -142,9 +142,12 @@ namespace StarfaceOutlookSync.UI
_outlookFolderPaths = outlook.GetContactFolderPaths();
}
}
catch
catch (Exception ex)
{
_outlookFolderPaths = new List<string> { "\\\\Kontakte" };
MessageBox.Show(
$"Outlook-Kontaktordner konnten nicht geladen werden:\n{ex.Message}\n\nIst Outlook gestartet?",
"Outlook-Verbindung", MessageBoxButtons.OK, MessageBoxIcon.Warning);
_outlookFolderPaths = new List<string>();
}
// Bestehende Werte laden