/CodeSteps.cs Secret
Created
August 19, 2018 13:25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Microsoft.Office.Tools.Ribbon; | |
using Outlook = Microsoft.Office.Interop.Outlook; | |
namespace CodeSteps_AddIn | |
{ | |
public partial class CodeSteps | |
{ | |
private void CodeSteps_Load(object sender, RibbonUIEventArgs e) | |
{ | |
} | |
private void button1_Click(object sender, RibbonControlEventArgs e) | |
{ | |
Outlook.Explorer explorer = Globals.ThisAddIn.Application.ActiveExplorer(); | |
// -- Display folders list | |
if (explorer != null) | |
{ | |
String folders = ""; | |
foreach (Outlook.Folder mailbox in explorer.Session.Folders) | |
{ | |
folders += mailbox.Name + "\n"; | |
try | |
{ | |
foreach (Outlook.Folder folder in mailbox.Folders) | |
{ | |
folders += "\t" + folder.Name + "\n"; | |
} | |
} | |
catch(Exception ex) | |
{ | |
; // nothing to do, for the moment | |
} | |
} | |
System.Windows.Forms.MessageBox.Show(folders); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment