Posts on Outlook

  1. MYN/1MTD and setting the Start Date in Outlook automagically.

    If you are using Outlook and want to force the start date to be set with a due date in the future by default you can use a macros which automatically runs for any new task item. In the VBA editor (Alt+F11) open up ThisOutlookSession In the code window add the following:

  2. Setting Outlook to use ISO values for week number.

    If you want to set outlook to follow the ISO week you need to make the following changes: Outlook 2007 and previous Tools-> Options…-> button Calendar Options… Outlook 2010 File-> section Options-> section Calendar   Set the following Options: First day of week: Monday First week of year: First 4-day week

  3. Getting a Outlook MailItem from a Ribbon Event

    You may find this code block handy: [csharp] /// /// Gets the mail item selected in the explorer view if one is selected or instance if that is the view active. /// /// The instance containing the event data. /// A Outlook.MailItem for the mail being viewed. private Outlook.MailItem GetMailItem(RibbonControlEventArgs e) { // Check to see if a item is select in explorer or we are in inspector. if (e.Control.Context is Outlook.Inspector) { Outlook.Inspector inspector = (Outlook.Inspector)e.Control.Context; if (inspector.CurrentItem is Outlook.MailItem) { return inspector.CurrentItem as Outlook.MailItem; } } if (e.Control.Context is Outlook.Explorer) { Outlook.Explorer explorer = (Outlook.Explorer)e.Control.Context; Outlook.Selection selectedItems = explorer.Selection; if (selectedItems.Count != 1) { return null; } if (selectedItems[1] is Outlook.MailItem) { return selectedItems[1] as Outlook.MailItem; } } return null; } [/csharp]