Consulting

Results 1 to 7 of 7

Thread: VBA question about Toolbar...

  1. #1
    VBAX Regular
    Joined
    Apr 2015
    Posts
    27
    Location

    VBA question about Toolbar...

    Hi all,

    I have a little question about toolbar. How do I add a "separator", or split into group 2 buttons on my toolbar? Example of my two buttons below I'd like to split with a "separator"

    Hope that make sense : (

    Regards to all,
    Philippe

                With .Add(Type:=msoControlButton)
                    .Caption = "Move Up"
                    .Style = msoButtonIcon
                    .OnAction = "MoveUp"
                    .FaceId = 3274
                End With
                With .Add(Type:=msoControlButton)
                    .Caption = "Move Down"
                    .Style = msoButtonIcon
                    .OnAction = "MoveDown"
                    .FaceId = 3275
                End With

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    In versions after 2003 you should be using XML to create ribbon controls not legacy code unless you are also targetting earlier versions

    Have a quick look at this example. You can download the free program CustomUI Editor to read the XML (and write more) Just Google

    this is the best book by far (most is relevant to 2010 / 2013)
    http://www.amazon.co.uk/RibbonX-Cust.../dp/0470191112
    Attached Files Attached Files
    Last edited by John Wilson; 05-11-2015 at 07:53 AM.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Regular
    Joined
    Apr 2015
    Posts
    27
    Location
    Thanks John, yes this toolbar I build is aimed also at older version, I just wondered how I could split those two button with a bar "|" or something like that to help users.

    Regards,
    Philippe

  4. #4
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    Don't believe it's possible in legacy code (I don't really code much for 2003 though)

    It's simple in XML but of course this only works in ribbon versions
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  5. #5
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    Someone is telling me here that you can use BeginGroup but I haven't tried at all.

    'ADD SEPERATOR <==============
    .BeginGroup = True
    .Caption = "Update Status Report"
    .OnAction = "MyMacro2"
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  6. #6
    VBAX Regular
    Joined
    Apr 2015
    Posts
    27
    Location
    Thanks a lot John! Yes I have tried .BeginGroup. It works on dropmenu but not on the toolbar itself..

    Many thanks for your help once again!

    Regards,
    Philippe

  7. #7
    MS Excel MVP VBAX Mentor Andy Pope's Avatar
    Joined
    May 2004
    Location
    Essex, England
    Posts
    344
    Location
    Begin group works for me in ppt2003

            With .Add(Type:=msoControlButton)
                .Caption = "Move Up"
                .Style = msoButtonIcon
                .OnAction = "MoveUp"
                .FaceId = 3274
            End With
            With .Add(Type:=msoControlButton)
                .Caption = "Move Down"
                .Style = msoButtonIcon
                .OnAction = "MoveDown"
                .FaceId = 3275
                .BeginGroup = True
            End With
    Cheers
    Andy

Posting Permissions

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