none
Make a custom toolbar/ribbon available to all users in Project client RRS feed

  • Question

  • Hello,

    we have PWA with Office 365 and we want to deploy a custom ribbon to all users in the enterprise in Project Professional client. We found this article on microsoft website :

    https://docs.microsoft.com/en-my/office/troubleshoot/project/custom-toolbarribbon-available-to-all-users

    Apparently this article does not apply to the newer versions of Project Pro. I am able to edit the Enterprise Global template but I don't know where I can save the ribbon to the enterprise global. Can somebody tell me how we can deploy new ribbon to every people opening a project coming from our enterprise server ?

    Thank you in advance for your help.

    zigune

    Tuesday, October 22, 2019 11:44 AM

Answers

  • Hi,

    it has to be

    ... "    <mso:button id=""Entreprise_Globale_create_engagements_0""... not ...RXActions + "    <mso:button idQ=""Entreprise_Globale_create_engagements_0"".... So without "Q".

    So code below: fisrt three lines are from you, with the correction "Q". Them I commented out how I would write it to make it easier to maintain. By the way: If you call this procedure from EGlobal, you don't need to mention that in "OnACtion"

      MRXActions = MRXActions + "<mso:group id=""MGMacros"" label=""Macros"" autoScale=""true"">"
      MRXActions = MRXActions + "    <mso:button id=""Entreprise_Globale_create_engagements_0"" label=""Faire la demande de ressources"" imageMso=""SlideMasterClipArtPlaceholderInsert"" onAction=""create_engagements"" visible=""true""/>"
      MRXActions = MRXActions + "</mso:group>"
    
      
    '  MRXActions = MRXActions + "<mso:group id=""MGMacros"" label=""Macros"" autoScale=""true"">"
    '  MRXActions = MRXActions + "  <mso:button id=""Entreprise_Globale_create_engagements_0"" "
    '  MRXActions = MRXActions + "    label=""Faire la demande de ressources"" "
    '  MRXActions = MRXActions + "    size=""large"" "
    '  MRXActions = MRXActions + "    imageMso=""SlideMasterClipArtPlaceholderInsert"" "
    '  MRXActions = MRXActions + "    screentip=""Some Text screentip"" "
    '  MRXActions = MRXActions + "    supertip=""Some More Text Supertip"" "
    '  MRXActions = MRXActions + "    onAction=""Entreprise Globale extraite!""/>"
    '  MRXActions = MRXActions + "</mso:group>"
    

    Does it work in this way?

    Barbara


    Barbara Henhapl Blog (English/German)

    • Marked as answer by zigune Wednesday, October 23, 2019 3:13 PM
    Wednesday, October 23, 2019 2:58 PM
    Moderator
  • Hi,

    if you start Project, the new displayed Project is still "Nothing".

    Please use

    Private Sub Project_Open(ByVal pj As Project)
    If Not pj Is Nothing Then
        Call CustomizeRibbon(pj)
    End If
    End Sub

    This should work.

    And I suggest to add an error handling as provided in my first sample. In the beginning:
    On Error GoTo ErrorHandling

    At the end:

    Exit Sub
    ErrorHandling
    :
      MsgBox
    "Ribbon could not be created", vbInformation, "No customized ribbon"
    End Sub

    Regards
    Barbara


    Barbara Henhapl Blog (English/German)

    • Marked as answer by zigune Thursday, October 24, 2019 8:54 AM
    Thursday, October 24, 2019 8:00 AM
    Moderator

All replies

  • zigune --

    You cannot distribute a custom ribbon to all users by adding it to the Enterprise Global, because you CANNOT add custom ribbons to the Enterprise Global.  Instead, you will need to export the ribbon customizations to a file.  Then e-mail the file to every user, along with the directions on how to import the ribbon customizations.  That's how to do it.  Hope this helps.


    Dale A. Howard [MVP]

    Tuesday, October 22, 2019 1:32 PM
    Moderator
  • Hi Dale,

    you are right - as long as you don't want to customize your ribbon with VBA :). In this case, you can use a macro to create the ribbon and to apply it e.g. with e.g. using Project_Activate or Project_Open.

    Regards
    Barbara


    Barbara Henhapl Blog (English/German)

    Tuesday, October 22, 2019 1:38 PM
    Moderator
  • Barbara --

    You are so right, my friend!  The user could create a macro to create the custom ribbon and put that in the Enterprise Global.  Thanks for the kind correction!  :)


    Dale A. Howard [MVP]

    Tuesday, October 22, 2019 11:17 PM
    Moderator
  • Thank you Barbara and Howard,

    it seems complicated as the code you mentionned here :

    https://social.technet.microsoft.com/Forums/projectserver/en-US/83615bc4-4ee4-4553-8731-c8c1aa596f34/runtime-error-when-running-macro-from-project-in-project-serverpwa-versus-ms-project-file?forum=projectprofessional2010general

    is not easy for me...

    zigune

    Wednesday, October 23, 2019 6:38 AM
  • Hi,

    I have just created a simple sample.

    1. Using Options dialog, I created some customization
    2. A new tab, called "aaa" and added before tab "Resource"
    3. Added two groups, named "bbb" and "ccc"
    4. "bbb" contains command Format painter
    5. "ccc" contains commands save and publish
    6. Exported customization
    7. Opened exported file with any editor

    This is the important part from exported file with some additional line breaks to make it readable:

    <mso:tabs>
     <mso:tab id="mso_c3.2747793B" label="aaa" insertBeforeQ="mso:TabResource">
      <mso:group id="mso_c4.2747793B" label="bbb" autoScale="true">
       <mso:control idQ="mso:FormatPainter" visible="true"/>
      </mso:group>
      <mso:group id="mso_c1.277971D5" label="ccc" autoScale="true">
       <mso:control idQ="mso:FileSave" visible="true"/>
       <mso:control idQ="mso:FilePublish" visible="true"/>
      </mso:group>
     </mso:tab>
    </mso:tabs>

    I used this part to change the macro.

    Sub TestCustomRibbon()
    Call CustomizeRibbon(ActiveProject)
    End Sub
    Sub CustomizeRibbon(pj As Project)
    
    Dim MyXML As String
    Dim MRXActions As String
    'Set pj = ActiveProject
    pj.SetCustomUI ("")
        
      On Error GoTo ErrorHandling
    
    
    
    'Using from exported file Project Customizations.exportedUI and get the imprtant part from it
    '<mso:tabs>
    '    <mso:tab id="mso_c3.2747793B" label="aaa" insertBeforeQ="mso:TabResource">
    '        <mso:group id="mso_c4.2747793B" label="bbb" autoScale="true">
    '            <mso:control idQ="mso:FormatPainter" visible="true"/>
    '        </mso:group>
    '        <mso:group id="mso_c1.277971D5" label="ccc" autoScale="true">
    '            <mso:control idQ="mso:FileSave" visible="true"/>
    '            <mso:control idQ="mso:FilePublish" visible="true"/>
    '        </mso:group>
    '    </mso:tab>
    '</mso:tabs>
    
      'Replace alle single " by double ""
      'define all groups and buttons inside your custom tab
      MRXActions = ""
      
      MRXActions = MRXActions + "<mso:group id=""MGbbb"" label=""bbb"" autoScale=""true"">"     'Replace id="mso_c4.2747793B" by some meaningful Id
      MRXActions = MRXActions + "    <mso:control idQ=""mso:FormatPainter"" visible=""true""/>"
      MRXActions = MRXActions + "</mso:group>"
    
      MRXActions = MRXActions + "<mso:group id=""MGccc"" label=""ccc"" autoScale=""true"">"
      MRXActions = MRXActions + "    <mso:control idQ=""mso:FileSave"" visible=""true""/>"
      MRXActions = MRXActions + "    <mso:control idQ=""mso:FilePublish"" visible=""true""/>"
      MRXActions = MRXActions + "</mso:group>"
        
     
      'create custom tab
      MyXML = ""
      MyXML = MyXML + "<mso:customUI xmlns:mso=""http://schemas.microsoft.com/office/2009/07/customui"">"
      MyXML = MyXML + "  <mso:ribbon startFromScratch=""false"">"
      MyXML = MyXML + "    <mso:tabs>"
      MyXML = MyXML + "      <mso:tab id=""MTaaa"" label=""aaa"" insertBeforeQ=""mso:TabResource"">"
      
      'insert groups and commands included in MRXACtions into custom tab
      MyXML = MyXML + MRXActions
       
      MyXML = MyXML + "      </mso:tab>"
      MyXML = MyXML + "    </mso:tabs>"
      MyXML = MyXML + "  </mso:ribbon>"
      MyXML = MyXML + "</mso:customUI>"
      
        
      '-------------------- Reset Ribbon and apply new --------------------
      
      pj.SetCustomUI ("")
      pj.SetCustomUI (MyXML)
    
      Exit Sub
    ErrorHandling:
      MsgBox "Ribbon could not be created", vbInformation, "No customized ribbon"
    End Sub

    Test by using TestCustomRibbon. If it works, add "Call CustomizeRibbon(pj)" in "ThisProject" from EGlobal into Project_Open and/or Project_Activate.

    Does that help?
    Barbara


    Barbara Henhapl Blog (English/German)

    Wednesday, October 23, 2019 9:14 AM
    Moderator
  • Hello Barbara,

    thank you for your help. I am almost good but not yet...

    Here is the exported customization :

    <mso:cmd app="MSProject" dt="1" />
    <mso:customUI xmlns:x1="http://schemas.microsoft.com/office/2009/07/customui/macro" xmlns:mso="http://schemas.microsoft.com/office/2009/07/customui">
    	<mso:ribbon>
    		<mso:qat>
    			<mso:sharedControls>
    				<mso:control idQ="mso:FileNewDefault" visible="false"/>
    				<mso:control idQ="mso:FileOpenUsingBackstage" visible="false"/>
    				<mso:control idQ="mso:FileSave" visible="true"/>
    				<mso:control idQ="mso:FileSaveAs" visible="false"/>
    				<mso:control idQ="mso:FileSendAsAttachment" visible="false"/>
    				<mso:control idQ="mso:FilePrintQuick" visible="false"/>
    				<mso:control idQ="mso:FilePrintPreview" visible="false"/>
    				<mso:control idQ="mso:ViewsGroup" visible="false" insertBeforeQ="mso:Undo"/>
    				<mso:control idQ="mso:PointerModeOptions" visible="false" insertBeforeQ="mso:Undo"/>
    				<mso:control idQ="mso:FilePublish" visible="true" insertBeforeQ="mso:Undo"/>
    				<mso:control idQ="mso:Undo" visible="true"/>
    				<mso:control idQ="mso:Redo" visible="true"/>
    			</mso:sharedControls>
    		</mso:qat>
    		<mso:tabs>
    			<mso:tab id="mso_c1.1FCD1C34" label="Test">
    				<mso:group id="mso_c2.1FCD1C34" label="Macros" autoScale="true">
    					<mso:button idQ="x1:Entreprise_Globale_extraite_create_engagements_0_1FCEA611" label="Faire la demande de ressources" imageMso="SlideMasterClipArtPlaceholderInsert" onAction="Entreprise Globale extraite!create_engagements" visible="true"/>
    				</mso:group>
    			</mso:tab>
    		</mso:tabs>
    		<mso:contextualTabs>
    			<mso:tabSet idMso="TabSetScrum">
    				<mso:tab idQ="mso:TabProjectScrum"/>
    			</mso:tabSet>
    		</mso:contextualTabs>
    	</mso:ribbon>
    </mso:customUI>

    And there the changed VBA :

    Sub TestCustomRibbon()
    Call CustomizeRibbon(ActiveProject)
    End Sub
    Sub CustomizeRibbon(pj As Project)
    
    Dim MyXML As String
    Dim MRXActions As String
    'Set pj = ActiveProject
    pj.SetCustomUI ("")
        
      On Error GoTo ErrorHandling
    
      MRXActions = ""
      
      MRXActions = MRXActions + "<mso:group id=""MGMacros"" label=""Macros"" autoScale=""true"">"
      MRXActions = MRXActions + "    <mso:button idQ=""Entreprise_Globale_create_engagements_0"" label=""Faire la demande de ressources"" imageMso=""SlideMasterClipArtPlaceholderInsert"" onAction=""Entreprise Globale extraite!create_engagements"" visible=""true""/>"
      MRXActions = MRXActions + "</mso:group>"
      
      'create custom tab
      MyXML = ""
      MyXML = MyXML + "<mso:customUI xmlns:mso=""http://schemas.microsoft.com/office/2009/07/customui"">"
      MyXML = MyXML + "  <mso:ribbon startFromScratch=""false"">"
      MyXML = MyXML + "    <mso:tabs>"
      MyXML = MyXML + "      <mso:tab id=""MTTest"" label=""Test"">"
      
      'insert groups and commands included in MRXACtions into custom tab
      MyXML = MyXML + MRXActions
       
      MyXML = MyXML + "      </mso:tab>"
      MyXML = MyXML + "    </mso:tabs>"
      MyXML = MyXML + "  </mso:ribbon>"
      MyXML = MyXML + "</mso:customUI>"
      
        
      '-------------------- Reset Ribbon and apply new --------------------
      
      pj.SetCustomUI ("")
      pj.SetCustomUI (MyXML)
    
      Exit Sub
    ErrorHandling:
      MsgBox "Ribbon could not be created", vbInformation, "No customized ribbon"
    End Sub
    
    Private Sub Project_Open(ByVal pj As Project)
    
    End Sub

    The ribbon is created but without button in it. I tried by changing the following line :

    MRXActions = MRXActions + "    <mso:button idQ=""Entreprise_Globale_create_engagements_for_selected_tasks_0"" label=""Faire la demande de ressources"" imageMso=""SlideMasterClipArtPlaceholderInsert"" onAction=""Entreprise Globale extraite!create_engagements_for_selected_tasks"" visible=""true""/>"

    By this one :

    MRXActions = MRXActions + "    <mso:button idQ=""x1:Entreprise_Globale_create_engagements_for_selected_tasks_0"" label=""Faire la demande de ressources"" imageMso=""SlideMasterClipArtPlaceholderInsert"" onAction=""Entreprise Globale extraite!create_engagements_for_selected_tasks"" visible=""true""/>"

    without more success.

    With this modification the ribbon disappears completely...

    Any idea of what I am doing wrong ?

    zigune



    • Edited by zigune Wednesday, October 23, 2019 12:57 PM error
    Wednesday, October 23, 2019 12:55 PM
  • Hi,

    it has to be

    ... "    <mso:button id=""Entreprise_Globale_create_engagements_0""... not ...RXActions + "    <mso:button idQ=""Entreprise_Globale_create_engagements_0"".... So without "Q".

    So code below: fisrt three lines are from you, with the correction "Q". Them I commented out how I would write it to make it easier to maintain. By the way: If you call this procedure from EGlobal, you don't need to mention that in "OnACtion"

      MRXActions = MRXActions + "<mso:group id=""MGMacros"" label=""Macros"" autoScale=""true"">"
      MRXActions = MRXActions + "    <mso:button id=""Entreprise_Globale_create_engagements_0"" label=""Faire la demande de ressources"" imageMso=""SlideMasterClipArtPlaceholderInsert"" onAction=""create_engagements"" visible=""true""/>"
      MRXActions = MRXActions + "</mso:group>"
    
      
    '  MRXActions = MRXActions + "<mso:group id=""MGMacros"" label=""Macros"" autoScale=""true"">"
    '  MRXActions = MRXActions + "  <mso:button id=""Entreprise_Globale_create_engagements_0"" "
    '  MRXActions = MRXActions + "    label=""Faire la demande de ressources"" "
    '  MRXActions = MRXActions + "    size=""large"" "
    '  MRXActions = MRXActions + "    imageMso=""SlideMasterClipArtPlaceholderInsert"" "
    '  MRXActions = MRXActions + "    screentip=""Some Text screentip"" "
    '  MRXActions = MRXActions + "    supertip=""Some More Text Supertip"" "
    '  MRXActions = MRXActions + "    onAction=""Entreprise Globale extraite!""/>"
    '  MRXActions = MRXActions + "</mso:group>"
    

    Does it work in this way?

    Barbara


    Barbara Henhapl Blog (English/German)

    • Marked as answer by zigune Wednesday, October 23, 2019 3:13 PM
    Wednesday, October 23, 2019 2:58 PM
    Moderator
  • Barbara you are great !!!

    It works. Many thanx ! Thank you for taking time to explain so much things to people who are asking !!!

    All the best.

    zigune

    Wednesday, October 23, 2019 3:14 PM
  • Hello Barbara,

    for you information it works only into Project_Activate. In Project_Open I have the following error :




    And if I click on "Debug". It stops on the following line (the first one in the code, not the last one...) :

    pj.SetCustomUI ("")

    Best regards.

    zigune

    Thursday, October 24, 2019 7:30 AM
  • Hi,

    if you start Project, the new displayed Project is still "Nothing".

    Please use

    Private Sub Project_Open(ByVal pj As Project)
    If Not pj Is Nothing Then
        Call CustomizeRibbon(pj)
    End If
    End Sub

    This should work.

    And I suggest to add an error handling as provided in my first sample. In the beginning:
    On Error GoTo ErrorHandling

    At the end:

    Exit Sub
    ErrorHandling
    :
      MsgBox
    "Ribbon could not be created", vbInformation, "No customized ribbon"
    End Sub

    Regards
    Barbara


    Barbara Henhapl Blog (English/German)

    • Marked as answer by zigune Thursday, October 24, 2019 8:54 AM
    Thursday, October 24, 2019 8:00 AM
    Moderator
  • Thank you Barbara,

    you are great, as always !

    zigune

    Thursday, October 24, 2019 1:23 PM