none
Outlook 2007 ribbon customization in .NET using VS2010; insertBeforeMso dynamic function RRS feed

  • Question

  • Hi,

    Could anyone help me get the first tab idMso value of an opened Outlook item window? I need to dynamically set it in a ribbon xml file, since I figured out it would be redundant to add each item window into the xml code. If anyone has an existing solution to share, that would be great.

    Thanks

    Monday, September 17, 2012 10:18 PM

Answers

  • Hi Ken,

    Thanks for answering my post. I'm a big fan of you by the way... :)

    Just now I happened to have solved my question for editing the Ribbon XML at runtime, here goes my solution and I never thought it was really simple

    Edit the return string from the GetCustomUI on runtime, while trapping which explorer item is being opened

    Public Function GetCustomUI(ByVal ribbonID As String) As String Implements Office.IRibbonExtensibility.GetCustomUI
        Dim strResText As String = ""
        Dim strGetRes As String = ""
    
        Select Case ribbonID
    
    
            Case "Microsoft.Outlook.Appointment"
    
                strGetRes = GetResourceText("OutlookAddIn.Ribbon1.xml")
                strResText = strGetRes.Replace("TabNewMailMessage", "TabAppointment") 'default value of it is TabNewMailMessage
    
            Case Else
    
                strResText = GetResourceText("OutlookAddIn.Ribbon1.xml")
    
        End Select
        Return strResText
    End Function

    Original XML string:

    <tab id="customTab" label="myCustomTab" insertBeforeMso="TabNewMailMessage" visible="true">

    New XML string on Appointment item window:

    <tab id="customTab" label="myCustomTab" insertBeforeMso="TabAppointment" visible="true">


    • Edited by Khem Oco Wednesday, September 19, 2012 5:23 AM
    • Marked as answer by Khem Oco Wednesday, September 19, 2012 5:29 AM
    Wednesday, September 19, 2012 5:22 AM

All replies

  • The answer to that would depend on what type of window, mail or appointment or whatever.
     
    Have you downloaded the developer information from the Office Developer site at MS that has all the ribbon id's for different types of items in Excel files? That will tell you exactly what you want to know.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Khem Oco" <=?utf-8?B?S2hlbSBPY28=?=> wrote in message news:564a04a2-b759-49a2-adcc-bc2a90af0e87...

    Hi,

    Could anyone help me get the first tab idMso value of an opened Outlook item window? I need to dynamically set it in a ribbon xml file, since I figured out it would be redundant to add each item window into the xml code. If anyone has an existing solution to share, that would be great.

    Thanks


    Ken Slovak MVP - Outlook
    Tuesday, September 18, 2012 1:28 PM
  • Hi Ken,

    Thanks for answering my post. I'm a big fan of you by the way... :)

    Just now I happened to have solved my question for editing the Ribbon XML at runtime, here goes my solution and I never thought it was really simple

    Edit the return string from the GetCustomUI on runtime, while trapping which explorer item is being opened

    Public Function GetCustomUI(ByVal ribbonID As String) As String Implements Office.IRibbonExtensibility.GetCustomUI
        Dim strResText As String = ""
        Dim strGetRes As String = ""
    
        Select Case ribbonID
    
    
            Case "Microsoft.Outlook.Appointment"
    
                strGetRes = GetResourceText("OutlookAddIn.Ribbon1.xml")
                strResText = strGetRes.Replace("TabNewMailMessage", "TabAppointment") 'default value of it is TabNewMailMessage
    
            Case Else
    
                strResText = GetResourceText("OutlookAddIn.Ribbon1.xml")
    
        End Select
        Return strResText
    End Function

    Original XML string:

    <tab id="customTab" label="myCustomTab" insertBeforeMso="TabNewMailMessage" visible="true">

    New XML string on Appointment item window:

    <tab id="customTab" label="myCustomTab" insertBeforeMso="TabAppointment" visible="true">


    • Edited by Khem Oco Wednesday, September 19, 2012 5:23 AM
    • Marked as answer by Khem Oco Wednesday, September 19, 2012 5:29 AM
    Wednesday, September 19, 2012 5:22 AM
  • ...the developer information from the Office Developer site at MS that has all the ribbon id's for different types of items

    Ok, If the idMso of the TabAppointment "Tags" Group is "GroupAppointmentOptions", what is the GroupName for the TabAppointment "Options" Group with ShowTimeAsGallery, Reminder, and Recurrence options?

    Wednesday, October 16, 2013 3:20 PM
  • The GroupAppointmentOptions group contains the following controls, according to the documentation I pointed you to in the file named "OutlookAppointmentItemRibbonControls.xls". Did you review those documents?

    ShowTimeAsGallery
    ReminderGallery
    ReminderSound
    Recurrence
    RecurrenceEditSeries
    ShowTimeZones
    CategorizeMenu
    Private
    HighImportance
    LowImportance

    ReminderSound


    Ken Slovak MVP - Outlook

    Wednesday, October 16, 2013 3:37 PM
  • Yes,

    Please confirm that the CategorizeMenu, Private, HighImportance, and LowImportance items are actually in a separate Group from these other ribbon items.  The spreadsheet appears to be in error as evidenced by this example:

    <group idMso="GroupAppointmentOptions" visible="false">

    "Options" Show As through Time Zones are still visible in the "Options" group whereas the "Tags" group disappears.

    Nobody's perfect.

    Wednesday, October 16, 2013 4:04 PM
  • The Outlook 2007 documentation shows what I showed earlier. The documentation for Outlook 2010 is different. I' haven't used any of those idMso's in my own code, so I can't say which documentation is in error if either is.

    In the 2010 documentation there are 2 groups, GroupAppointmentOptions and GroupAppointmentMoreOptions. According to that documentation here is what is in each group:

    GroupAppointmentOptions:

    PolicyTagsMenu
    ArchivePolicyTagsGallery
    RetentionPolicyTagsGallery
    AllRetentionPolicyTags
    CategorizeMenu
    ClearAllCategories
    CategorizeGallery
    AllCategories
    Private
    HighImportance

    LowImportance

    GroupAppointmentMoreOptions:

    ShowTimeAsGallery

    ReminderGallery
    ReminderSound
    Recurrence
    RecurrenceEditSeries
    ShowTimeZones
    RoomFinder
    ReminderSound

    Ken Slovak MVP - Outlook

    Wednesday, October 16, 2013 4:47 PM