0

I've created a custom Powerpoint add-in (ppam) using the following code (from this tutorial https://www.rdpslides.com/pptfaq/FAQ00031_Create_an_ADD-IN_with_TOOLBARS_that_run_macros.htm):

Sub Auto_Open()
   Dim oToolbar As CommandBar
   Dim oButton As CommandBarButton
   Dim MyToolbar As String

   MyToolbar = "My toolbar"

   On Error Resume Next

   Set oToolbar = CommandBars.Add(Name:=MyToolbar, _
       Position:=msoBarFloating, Temporary:=True)
   If Err.Number <> 0 Then
         Exit Sub
   End If

   On Error GoTo ErrorHandler

   Set oButton = oToolbar.Controls.Add(Type:=msoControlButton)

   With oButton

        'repeat code for each button'

   End With
   
   oToolbar.Visible = True

NormalExit:
    Exit Sub

ErrorHandler:
    MsgBox Err.Number & vbCrLf & Err.Description
    Resume NormalExit:
End Sub

It works well, and I've been able to add multiple buttons to the Add-in toolbar. However, all buttons crowd on the same row, and I would really like to have a row-break, in order to fit more buttons in the toolbar overview.

I've tried to create separate add-in's for them to display on separate rows, but that just leads to one of the add-ins not showing. Is there a way to add a row-break to the add-in?

dsplnm
  • 1
  • 1
    That's a very old page by Steve Rindsberg that reflects the technology used in Office 2003 and earlier. The current best practice is to edit the Ribbon. That also gives you much more flexibility to size and spacing of icons. Here's a link to the most up-to-date Ribbon editor: https://github.com/fernandreu/office-ribbonx-editor. A simpler alternative would be to add your commands using the Quick Access Toolbar, where they automatically stretch across the screen. They get keyboard shortcuts, too. The seventh QAT icon can be run with Alt + 7. – John Korchok Dec 13 '21 at 18:25
  • Steve Rindsberg here, chiming in to agree with John. I really need to update that page! – Steve Rindsberg Dec 14 '21 at 15:30

0 Answers0