none
Project Professional 2010/ Ribbon Customization/ Set focus on custom tab RRS feed

  • Frage

  • Hi all,

    for the MS Project Professional 2010 Client i have created a customized ribbon tab. I'm using the SetCustomUI Method to describe the new tab in a XML-String. The new tab is structured according to a PM-Process (Initiation, Planning, Exectution, Controlling, Reporting) and groups different functions and customized views. The customized tab is located before the tab for the tasks (...insertBeforeQ=""mso:TabTask""..), so it appears right after the file background menu tab. Unfortunately after starting the client the focus is set to to the tab for tasks.

    My question now is if anybody knows how to set the focus on an customized tab in the ribbon menu?

    Thank you in advance!

    Best Regards,

    Philipp

    Dienstag, 1. März 2011 09:18

Antworten

  • Hallo,

    up to now i have only found a rather non-elegant approach by using the Sendkey-Method:

    Sendkey "%Y1%", false

    This works quite good, except for the beep.

    Best Regards

    Philipp

    Freitag, 11. März 2011 08:58

Alle Antworten

  • Hallo PhilippH,

    PhilippH schrieb folgendes:

    My question now is if anybody knows how to set the focus on an
    customized tab in the ribbon menu?

    possibly helps:

    http://www.accessribbon.de/en/index.php?Access_-_Ribbons:Update_Ribbons_Dynamically
    and to activate:
    gobjRibbon.ActivateTab "idOfTheTab"
    Gruß
    Gunter


    Access FAQ: http://www.donkarl.com

          http://www.avenius.de - http://www.AccessRibbon.de
    http://www.ribboncreator.de - http://www.ribboncreator2010.de

    Dienstag, 1. März 2011 13:14
  • Hallo Gunter,

    i'm using the above described code in the enterprise global, so at the moment my only option to store the xml-code would be in the e-globals modules and i am not sure if i can use callback-functions within a string that is given to method SetCustomUI:

    Public Sub AddCustomRibbon()
       
        Dim ribbonXml As String
       
        ribbonXml = "<mso:customUI xmlns:mso=""http://schemas.microsoft.com/office/2009/07/customui"">"
        ribbonXml = ribbonXml + "  <mso:ribbon>"
        ribbonXml = ribbonXml + "    <mso:tabs>"
        ribbonXml = ribbonXml + "      <mso:tab id=""MyTab"" label=""" MyTab """ insertBeforeQ=""mso:TabTask"">"
       
        ribbonXml = ribbonXml + "        <mso:group id=""group_File"" label=""" File""" autoScale=""true"">"
        ribbonXml = ribbonXml + "           <mso:button idMso=""FileOpen"">"
        ribbonXml = ribbonXml + "           <mso:button idMso=""FileSave""/>"
        ribbonXml = ribbonXml + "           <mso:button idMso=""FilePublish""/>"
        ribbonXml = ribbonXml + "        </mso:group>"
      
        ribbonXml = ribbonXml + "    </mso:tabs>"
        ribbonXml = ribbonXml + "  </mso:ribbon>"
        ribbonXml = ribbonXml + "</mso:customUI>"
       
        ActiveProject.SetCustomUI (ribbonXml)

    End Sub

    I'll check your link and see if i can make use of it.

    Thank you and Best Regards

    Philipp

    Dienstag, 1. März 2011 17:48
  • Hallo Gunter,

    i tried your approach:

    Public Sub AddCustomRibbon()
       
        Dim ribbonXml As String
       
        ribbonXml = "<mso:customUI xmlns:mso=""http://schemas.microsoft.com/office/2009/07/customui"" onLoad=""ActivateTab"">"
        ribbonXml = ribbonXml + "  <mso:ribbon>"
        ribbonXml = ribbonXml + "    <mso:tabs>"
        ribbonXml = ribbonXml + "      <mso:tab id=""MyTab"" label=""" MyTab """ insertBeforeQ=""mso:TabTask"">"
       
        ribbonXml = ribbonXml + "        <mso:group id=""group_File"" label=""" File""" autoScale=""true"">"
        ribbonXml = ribbonXml + "           <mso:button idMso=""FileOpen"">"
        ribbonXml = ribbonXml + "           <mso:button idMso=""FileSave""/>"
        ribbonXml = ribbonXml + "           <mso:button idMso=""FilePublish""/>"
        ribbonXml = ribbonXml + "        </mso:group>"
      
        ribbonXml = ribbonXml + "    </mso:tabs>"
        ribbonXml = ribbonXml + "  </mso:ribbon>"
        ribbonXml = ribbonXml + "</mso:customUI>"
       
        ActiveProject.SetCustomUI (ribbonXml)

    End Sub

    ....

    Dim gobjRibbon as IRibbonUI

    ....

    Public Sub ActivateTab(ribbon As IRibbonUI)

    set gobjRibbon = ribbon

    gobjRibbon.ActivateTab "MyTab"

    End Sub

    Unfortunately i'm getting an automation error ("Automation error. Exception occured") when starting the client, but the ribbon is loaded correctly? Do you or anybody know if callback functions do work in the context of Project Server 2010/ Project Professional 2010?

    Best Regards

    Philipp

     

    Dienstag, 8. März 2011 08:35
  • Hallo PhilippH,

    PhilippH schrieb folgendes:
    ...

    Unfortunately i'm getting an automation error ("Automation error. Exception occured") ...

    I don´t use Project, but on mistake are:

    wrong:

    set gobjRibbon = ribbon
    ribbon.ActivateTab "MyTab"

    right:

    set gobjRibbon = ribbon
    gobjRibbon.ActivateTab "MyTab"*

    Gruß
    Gunter


    Access FAQ: http://www.donkarl.com

          http://www.avenius.de - http://www.AccessRibbon.de
    http://www.ribboncreator.de - http://www.ribboncreator2010.de

    Dienstag, 8. März 2011 08:42
  • Hi Gunter,

     

    thank you for the hint, but none of the two versions seems to work. The asterisk doesn't have a particular meaning?!?

    Best Regards

    Philipp

    Dienstag, 8. März 2011 14:13
  • Hallo,

    up to now i have only found a rather non-elegant approach by using the Sendkey-Method:

    Sendkey "%Y1%", false

    This works quite good, except for the beep.

    Best Regards

    Philipp

    Freitag, 11. März 2011 08:58