Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,

i have two list boxes. i want contact synchronization folder and email synchronization folder in list boexs.


i tried following code...
C#
private void EnumerateFoldersInDefaultStore()
{
    Outlook.Folder root = Application.Session.DefaultStore.GetRootFolder() as Outlook.Folder;
    EnumerateFolders(root);
}

private void EnumerateFolders(Outlook.Folder folder)
{
    Outlook.Folders childFolders = folder.Folders;
    if (childFolders.Count > 0)
    {
        foreach (Outlook.Folder childFolder in childFolders)
        {
            EnumerateFolders(childFolder);
           listBox1.Items.Add(childFolder.Name);
        }
    }
}

i want.....

If the type == olMailItem than include in the 1st listbox

If the type == olContactItem than include in the 2nd listbox


[Edit member="Tadit"]
Added pre tags.
[/Edit]
Posted
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900