none
How can I debug an Outlook Addin with Office 2013 RRS feed

  • Question

  • I've an Outlok AddIn for Office 2010 and want also use (and deploy) it for Office 2013.

    The Addin works in Office 2013 but only with the half of its functions.

    A Task Pane which is created from the AddIn is not visible and the Contextmenu-Buttons are not visble (the handler of the Application.ItemContextmenuDisplay event is not executed).

    I want to debug the Addin to find out what the problem is. How can I do that?

    When I start the Add-In from Visual Studio (2010 or 2012) on a System where Office 2013 is installed I get the error message that I need Office 2010 for debugging.

    Does anybody know how an AddIn can be debugged with Office 2013?

    Thanks in advance!


    Regards From Austria Manfred Homm


    Saturday, July 6, 2013 9:13 AM

Answers

  • The Application level context menus need to be changed to use the new XML based context menus. That also applies to Outlook 2010, but in 2013 they're deprecated. You use the Explorer XML for that. See http://msdn.microsoft.com/en-us/library/office/ee692172(v=office.14).aspx for information on this. It applies to 2010 but also to 2013.

    I port the source project over to a machine with VS 2010 and Office 2013 installed. I refactor the Office and Outlook references to 2013 and compile and go, that way I can debug directly running on 2013.


    Ken Slovak MVP - Outlook

    Tuesday, July 9, 2013 3:44 PM
    Moderator
  • Does getItemLabel not work? That's what I would use to return the label of each item in the dropDown. Are you using this signature for the callback?

    string GetItemLabel(IRibbonControl control, int index)

    As far as the onAction signature, and other callback signatures, there's no way to automatically generate the callback signatures when using ribbon XML. According to the 3rd article in the series I pointed you to, which has a complete list of all callback signatures, what you'd use for a dropDown control in C# would be this:

    void OnAction(IRibbonControl control, string selectedId, int selectedIndex)

    I would spend some time reviewing all 3 articles in the series. There are others that have useful information, and some things have been added since Office 2007 (such as Backstage), but for the most part those articles are the bible for ribbon customizations.

    I'd also look up the articles written by Randy Byrne for various "What's New for Developers in Outlook 20xx" (2007, 2010, 2013) versions. Randy was the PM who owned the Outlook object model until recently, and almost no one around knows more about how things work with the object models, plus he was a very highly regarded Outlook developer MVP until he went to MS to own the OOM. The articles are on the MS Office Developer site at MSDN, and have information and code samples for all the new stuff since Outlook 2007.


    Ken Slovak MVP - Outlook

    • Marked as answer by ManfredHomm Wednesday, August 7, 2013 9:41 AM
    Friday, August 2, 2013 5:38 PM
    Moderator
  • You may also need to change the reference to Outlook to Outlook 15.

    I usually make changes like that in the References section of the project in the Solution Explorer. You may need to show all files for the project to see References.


    Ken Slovak MVP - Outlook

    Wednesday, July 10, 2013 2:44 PM
    Moderator

All replies

  • VS2010 doesnot have Office 2013 adin template.

    VS 2012 with Office 2013 installed should work. Do you have multiple versions of Office installed?



    with regards, Yuri

    Tuesday, July 9, 2013 1:44 PM
  • The Application level context menus need to be changed to use the new XML based context menus. That also applies to Outlook 2010, but in 2013 they're deprecated. You use the Explorer XML for that. See http://msdn.microsoft.com/en-us/library/office/ee692172(v=office.14).aspx for information on this. It applies to 2010 but also to 2013.

    I port the source project over to a machine with VS 2010 and Office 2013 installed. I refactor the Office and Outlook references to 2013 and compile and go, that way I can debug directly running on 2013.


    Ken Slovak MVP - Outlook

    Tuesday, July 9, 2013 3:44 PM
    Moderator
  • Hi Ken,

    to do it with VS 2010 sounds good.

    You wrote " I refactor the Office and Outlook references to 2013 ". How can I do this?


    Regards From Austria Manfred Homm

    Wednesday, July 10, 2013 12:37 PM
  • Hi Yuri,

    in VS 2012 I only find templates for Office 2010. Is there a service pack which contains Office 2013 templates?

    I have only Office 2013 installed on the system with VS 2012.


    Regards From Austria Manfred Homm


    • Edited by ManfredHomm Wednesday, July 10, 2013 12:49 PM correction
    Wednesday, July 10, 2013 12:49 PM
  • Hi Ken,

    I found it out for myself. In the .csproj file there were only the parameter OfficeVersion="15.0" to set.

    Many thanks for your help!


    Regards From Austria Manfred Homm

    Wednesday, July 10, 2013 1:43 PM
  • You may also need to change the reference to Outlook to Outlook 15.

    I usually make changes like that in the References section of the project in the Solution Explorer. You may need to show all files for the project to see References.


    Ken Slovak MVP - Outlook

    Wednesday, July 10, 2013 2:44 PM
    Moderator
  • Hi Ken,

    Can you help me once again in this issue?

    I'm now on the way to change all Ribbon Elements to XML.

    I've now the problem that I can't find a detailed description of the objects.

    E.g: I've placed a combobox in my Ribbon. This is the XML definition therefore:

    <dropDown id="FolderView"
                        onAction="e_dropDownFolderView_onAction"
                        getLabel="m_GetControlLabel"
                        showLabel="false"
                        sizeString="Nur aktive Ordner zeigen"
                        showItemImage="false"
                        getItemLabel="m_GetControlLabel"
                        getImage="m_GetControlImage"
                        tag="Logo_16.bmp"
                        getSelectedItemIndex="m_dropDownFolderView_getSelectedItemIndex">
                <item id="ButtonShowActive" />
                <item id="ButtonShowAll" />
              </dropDown>

    There are two questions:

    1. How can I add localized items to the dropDown? As you see in the example I "guessed" to use the "getItemLabel" property. But it doesn't work.

    2. How can I find the signature of the "onAction" Handler?

    On my search for answers I always got only examples but I think there must be a complete reference for it.


    Regards From Austria Manfred Homm

    Friday, August 2, 2013 9:23 AM
  • I'm not sure what you mean by adding localized items. If you mean in a local language, it's up to you to supply the correct text based on the current runtime language when the ribbon callbacks happen.

    The basics of the ribbon customization references are in the 3 articles starting at http://msdn.microsoft.com/en-us/library/office/aa338202(v=office.12).aspx. They're for Office 2007, but are applicable to all Office versions with the ribbon. Part 2 has specifics for all the ribbon control types at this link: http://msdn.microsoft.com/en-us/library/office/aa338199(v=office.12).aspx#OfficeCustomizingRibbonUIforDevelopers2_Detailed

    You can also do a Web search for "customize Office fluent ribbon" and see lots of other reference materials.


    Ken Slovak MVP - Outlook

    Friday, August 2, 2013 2:09 PM
    Moderator
  • Hi Ken,

    thanks for quick answer!

    My problem with the localization is the following:

    1. The <item> element has no "getLabel" property. The "label" property I can't use because I must fill it with different languages. So I thought that the "getItemLabel" in the <DropDown> element will be called to get the text of the items. But that doesn't work in this way. The "getControlLabel" Method is not invoked for the items. I get items without text.

    2. I've implemented the "onAction" Handler for the DropDown object with following signature:

            public void e_dropDownFolderView_onAction(Office.IRibbonControl control)
            {
                Type l_Test = control.GetType();
            }
    This causes the error: "Callback signature missmatch: "e_dropDownFolderView_onAction(Office.IRibbonControl control)"

    Working with the Visual Designer I got the signation automatically (via the property window or with TAB). Is there a similar way for XML?





    Regards From Austria Manfred Homm

    Friday, August 2, 2013 2:58 PM
  • Does getItemLabel not work? That's what I would use to return the label of each item in the dropDown. Are you using this signature for the callback?

    string GetItemLabel(IRibbonControl control, int index)

    As far as the onAction signature, and other callback signatures, there's no way to automatically generate the callback signatures when using ribbon XML. According to the 3rd article in the series I pointed you to, which has a complete list of all callback signatures, what you'd use for a dropDown control in C# would be this:

    void OnAction(IRibbonControl control, string selectedId, int selectedIndex)

    I would spend some time reviewing all 3 articles in the series. There are others that have useful information, and some things have been added since Office 2007 (such as Backstage), but for the most part those articles are the bible for ribbon customizations.

    I'd also look up the articles written by Randy Byrne for various "What's New for Developers in Outlook 20xx" (2007, 2010, 2013) versions. Randy was the PM who owned the Outlook object model until recently, and almost no one around knows more about how things work with the object models, plus he was a very highly regarded Outlook developer MVP until he went to MS to own the OOM. The articles are on the MS Office Developer site at MSDN, and have information and code samples for all the new stuff since Outlook 2007.


    Ken Slovak MVP - Outlook

    • Marked as answer by ManfredHomm Wednesday, August 7, 2013 9:41 AM
    Friday, August 2, 2013 5:38 PM
    Moderator
  • Hi Ken,

    now I've found it!

    Many thanks for your help and the useful hints!


    Regards From Austria Manfred Homm

    Wednesday, August 7, 2013 9:43 AM