Consulting

Results 1 to 5 of 5

Thread: Changing the active ribbon when PPT starts

  1. #1
    VBAX Contributor
    Joined
    Apr 2015
    Location
    Germany
    Posts
    167
    Location

    Changing the active ribbon when PPT starts

    Hi there,

    well, I don't know, if it is an XML question:


    When I open PowerPoint, the "Start"-ribbon always is the active one. I would love to have my self-built add-in-ribbon (let's call it "RG Home") being the active ribbon, when I start PowerPoint.

    I had a look into the PowerPoint options but didn't find anything helpful. Have I been too blind? Or is it an XML thing? Or something to do in the registry?

    I would be interested in finding out how to do this.

    Thank you,
    RG

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,711
    Location
    https://msdn.microsoft.com/en-us/lib.../ff861125.aspx


    2010 and later only

    Public myRibbon As IRibbonUI 
     
    Sub tabActivate(ByVal control As IRibbonControl) 
         myRibbon.ActivateTab (control.ID) 
    End Sub
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  3. #3
    VBAX Contributor
    Joined
    Apr 2015
    Location
    Germany
    Posts
    167
    Location
    Dear Paul,

    maybe I'm already too tired ... night falls over Western Europe ... do I have to change anything to tell the macro the name of my tab? I tried renaming the tab id in XML to "myRibbon", I tried renaming my module to "myRibbon" or to "RibbonControl" and I tried with not changing anything. My tab stays in the background ... What am I doing wrong? Sorry for my stupidity ... most of things I do around VBA and XML still are trial and error ... (I work with 2010, that shouldn't be the reason)

    Thanks,
    Rob

  4. #4
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,711
    Location
     'Callback for customUI.onLoad
    Sub OnRibbonLoad(ribbon As IRibbonUI)
        Dim x As Object
        Set oRibbon = ribbon
        On Error Resume Next
        Set x = Application.ActiveWindow.View.Slide.Shapes("Draftmaster")
        On Error GoTo 0
         
        bMarkedDraft = Not (x Is Nothing)
        oRibbon.Invalidate
        
        oRibbon.ActivateTab ("RGHomeTab")
        
    End Sub
    Attached Files Attached Files
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  5. #5
    VBAX Contributor
    Joined
    Apr 2015
    Location
    Germany
    Posts
    167
    Location
    Aaaah ... it was

    (control.id)

    that had to be replaced!

    OMG ... your quote in the other thread is really so true ... :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •