Autor: Uwe Küstner --- Aus Excel VBA - Gruppe:
VerschiedenesFaceId von Schaltflächen
Autor: Uwe Küstner - Erstellt: -- - Letzte Revision: --
Hier ein kleines Programm , welches ihnen nach dem starten der Routine "Symbolanzeige", die in Office verfügbaren Schaltflächensymbole anzeigt.
Wenn sie mit dem Mauszeiger über das Symbol gehen, wird ihnen die FaceId - Nummer angezeigt.
Option Explicit
Dim cbSymbolliste As CommandBar
Dim lngZaehler As Long
Sub Symbolanzeige()
Dim cbSteuerung As CommandBar
Dim ctlVor As CommandBarButton
Dim ctlZurueck As CommandBarButton
Dim ctlAbbruch As CommandBarButton
Set cbSymbolliste = CommandBars.Add(Name:="Symbol-Liste", Temporary:=True)
With cbSymbolliste
.Top = 200
.Left = 250
End With
lngZaehler = 1
On Error Resume Next
CommandBars("Steuerung").Delete
On Error GoTo 0
Set cbSteuerung = CommandBars.Add(Name:="Steuerung", Temporary:=True)
Set ctlZurueck = cbSteuerung.Controls.Add(Type:=msoControlButton)
With ctlZurueck
.Caption = "Zurück"
.FaceId = 155
.OnAction = "ListeZurueck"
End With
Set ctlAbbruch = cbSteuerung.Controls.Add(Type:=msoControlButton)
With ctlAbbruch
.Caption = "Abbrechen"
.Style = msoButtonCaption
.OnAction = "ListeAbbruch"
End With
Set ctlVor = cbSteuerung.Controls.Add(Type:=msoControlButton)
With ctlVor
.Caption = "Vor"
.FaceId = 156
.OnAction = "ListeVor"
End With
With cbSteuerung
.Top = 150
.Left = 200
.Visible = True
.Protection = msoBarNoChangeVisible + msoBarNoCustomize
End With
NeueListe 0, 499
End Sub
Private Sub ListeVor()
NeueListe 0, 499
End Sub
Private Sub ListeZurueck()
If lngZaehler <= 501 Then Exit Sub
NeueListe -1000, -501
End Sub
Private Sub ListeAbbruch()
cbSymbolliste.Delete
Set cbSymbolliste = Nothing
CommandBars("Steuerung").Delete
End Sub
Private Sub NeueListe(lngStart As Long, lngEnde As Long)
Dim ctl As CommandBarControl
Dim i As Long
Dim x As Integer
Dim E As Integer
Dim B
x = 0
E = 0
On Error GoTo Ende
With CommandBars("Steuerung").Controls(3)
.Caption = "Vor"
.Enabled = True
End With
cbSymbolliste.Visible = False
For Each ctl In cbSymbolliste.Controls
ctl.Delete
Next ctl
For i = lngZaehler + lngStart To lngZaehler + lngEnde
Set ctl = cbSymbolliste.Controls.Add(Type:=msoControlButton)
With ctl
.FaceId = i
.TooltipText = i
End With
If x = 1 Then
ctl.Delete
If E = 0 Then E = i
Exit For
End If
x = 0
Next i
lngZaehler = lngZaehler + lngEnde + 1
If E = 0 Then E = i
With cbSymbolliste
.Width = 600
.Name = "Symbol-Liste (" & lngZaehler - 500 & " - " & E - 1 & ")"
.Visible = True
.Protection = msoBarNoChangeVisible + msoBarNoCustomize
End With
x = 0
If lngZaehler <= 501 Then
With CommandBars("Steuerung").Controls(1)
.Caption = ""
.Enabled = False
End With
Else
With CommandBars("Steuerung").Controls(1)
.Caption = "Zurück"
.Enabled = True
End With
End If
Exit Sub
Ende:
With CommandBars("Steuerung").Controls(3)
.Caption = ""
.Enabled = False
End With
x = 1
Resume Next
End Sub
Weitere Artikel der Gruppe: Verschiedenes Aus Excel VBA
Nach oben