This macro was available online, it shows FaceIDs in a toolbar.
If the number of menu items is more than screen height, there's and overflow.
Is it possible to remove overflow and have items on more than 1 column.
If the number of menu items is more than screen height, there's and overflow.
Is it possible to remove overflow and have items on more than 1 column.
VBA Code:
Option Explicit
Const APP_NAME = "FaceIDs (Browser)"
' The number of icons to be displayed in a set.
Const ICON_SET = 30
Dim bunch_qty
Sub BarOpen()
Dim xBar As CommandBar
Dim xBarPop As CommandBarPopup
Dim bCreatedNew As Boolean
Dim n As Integer, m As Integer
Dim k As Integer
bunch_qty = 30 * 30
On Error Resume Next
' Try to get a reference to the 'FaceID Browser' toolbar if it exists and delete it:
Set xBar = CommandBars(APP_NAME)
On Error GoTo 0
If Not xBar Is Nothing Then
xBar.Delete
Set xBar = Nothing
End If
Set xBar = CommandBars.Add(Name:=APP_NAME, Temporary:=True) ', Position:=msoBarLeft
With xBar
.Visible = True
'.Width = 80
For k = 0 To 5 ' 5 dropdowns, each for about "bunch_qty" FaceIDs
Set xBarPop = .Controls.Add(Type:=msoControlPopup) ', Before:=1
With xBarPop
.BeginGroup = True
If k = 0 Then
.Caption = "Face IDs " & 1 + bunch_qty * k & " ... "
Else
.Caption = 1 + bunch_qty * k & " ... "
End If
n = 1
Do
With .Controls.Add(Type:=msoControlPopup) '30 items * 30 items = 900 faceIDs
.Caption = bunch_qty * k + n & " ... " & bunch_qty * k + n + ICON_SET - 1
For m = 0 To ICON_SET - 1
With .Controls.Add(Type:=msoControlButton) '
.Caption = "ID=" & bunch_qty * k + n + m
.FaceId = bunch_qty * k + n + m
End With
Next m
End With
n = n + ICON_SET
Loop While n < bunch_qty ' or 1020, some overlapp
End With
Next k
End With 'xBar
End Sub