none
Project 2010 backstage view - using getHelperText element. RRS feed

  • Question

  • Hi,

    I have been experimenting with extending the backstage for Project 2010 specifically getting them to dynamically show some information from Project Server. After reading through the Project SDK and also an excellent article on MSDN about customizing the Excel backstage, I have been trying to use the getHelperText elements to call a sub to populate the helper text of the control, to no avail.

    Is there a limitation in using these elements within the setCustomUI infrastructure required for Project 2010?

    The code I have is as follows:

    Private Sub AddAlertBackstageTab()
    
        Dim backstageXML As String
    
        backstageXML = "<customUI 
    xmlns=""http://schemas.microsoft.com/office/2009/07/customui"">"
        backstageXML = backstageXML + " <backstage>"
        backstageXML = backstageXML + "  <tab idMso=""TabInfo"">"
        backstageXML = backstageXML + "    <firstColumn>"
        backstageXML = backstageXML + "      <group id=""grpOne"" 
    insertAfterMso=""GroupOfflineGlobalTemplate"" label=""Secret Feature"" 
    getHelperText=""getFeatureHelperText"">"
        backstageXML = backstageXML + "        <primaryItem>"
        backstageXML = backstageXML + "          <button id=""btnFeature"" 
    label=""Do thing"" />"
        backstageXML = backstageXML + "        </primaryItem>"
        backstageXML = backstageXML + "       </group>"
        backstageXML = backstageXML + "    </firstColumn>"
        backstageXML = backstageXML + "  </tab>"
        backstageXML = backstageXML + " </backstage>"
        backstageXML = backstageXML + "</customUI>"
    
        ActiveProject.SetCustomUI (backstageXML)
    
    End Sub
    
    Sub getFeatureHelperText(control As IRibbonControl, ByRef returnedVal)
        returnedVal = "Feature Text"
    End Sub
    
    Private Sub Project_Open(ByVal pj As Project)
            AddAlertBackstageTab
    End Sub
    

    Any help would be gratefully received. 

    Regards,

    Alex.

    Alex Burton www.epmsource.com
    Wednesday, March 10, 2010 9:33 PM
    Moderator

Answers

  • I had a eureka moment on this tonight. 

    As the backstage xml is being built programatically, there is no need to use any of the callbacks, instead you can simply declare a variable in code and add it to the xml string as it is being built. 

    As in the example code above, you can replace the getHelperText line with a reference to helperText and a variable to show the information.

        backstageXML = backstageXML + "      <group id=""grpOne"" label=""Feature"" helperText=""" + grpOneFeatureText + """>"
    
    Then all is needed is to populate the variable before the XML is built and the setCustomUI call is made. 

    I can't believe I didn't think of this to start with.. d0h :) 

    Alex.

    Alex Burton www.epmsource.com
    Thursday, March 18, 2010 11:24 AM
    Moderator