aniruddh
New Member
- Outlook version
- Outlook 2010 32 bit
- Email Account
hi there,
using C#
i have two list boxes. i want contact synchronization folder and email synchronization folder in list boexs.
i tried following code...
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
how can i do this?
using C#
i have two list boxes. i want contact synchronization folder and email synchronization folder in list boexs.
i tried following code...
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
how can i do this?