Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2002
    Posts
    6

    Question Unanswered: List of all FaceIDs needed

    Hi everybody,

    i'm trying to program my own menuebar with VBA.
    Some items should get an icon and i need to know the FaceIDs of the different icons.

    Is there a list online with the different IDs and the corresponding icons?

    thx a lot

    Hendrik

  2. #2
    Join Date
    Oct 2002
    Location
    Sao Paulo - Brazil
    Posts
    16
    Hi HTS,

    I believe have found what you need, MSDN library. Try this:

    1 - Make a refence to "Microsoft Office 9.0 Object Library" (My Access is the 2000 version)

    2 - In new module, put this code:

    Public Sub ListButtonPicturesAndIDs(ByVal intStart As Integer, _
    ByVal intEnd As Integer)

    ' Purpose: Given a starting and ending number, creates a
    ' command bar with pictures corresponding to the face IDs
    ' in the range of numbers provided.

    Dim objCommandBar As CommandBar
    Dim objCommandBarButton As CommandBarButton
    Dim intButton As Integer

    On Error GoTo ListButtonPicturesAndIDs_Err

    If intStart > intEnd Then

    MsgBox "Ending number must be smaller than starting number. " & _
    "Please try again."

    Exit Sub

    End If

    For Each objCommandBar In Application.CommandBars

    If objCommandBar.Name = "Button Pictures and IDs" Then

    objCommandBar.Delete

    End If

    Next objCommandBar

    Set objCommandBar = _
    Application.CommandBars.Add("Button Pictures and IDs", , , True)

    For intButton = intStart To intEnd

    Set objCommandBarButton = _
    objCommandBar.Controls.Add(msoControlButton, , , , True)

    With objCommandBarButton
    .FaceId = intButton
    .TooltipText = "FaceID = " & intButton
    End With

    Next intButton

    objCommandBar.Visible = True

    ListButtonPicturesAndIDs_End:

    Exit Sub

    ListButtonPicturesAndIDs_Err:

    Select Case Err.Number

    Case -2147467259 ' Invalid FaceIDs.
    MsgBox "Invalid range of numbers for face IDs. " & _
    "Please try again."
    Case Else
    MsgBox "Error " & Err.Number & ": " & Err.Description

    End Select

    Resume ListButtonPicturesAndIDs_End

    End Sub

    Public Sub TestListButtonPicturesAndIDs()

    Call ListButtonPicturesAndIDs(100, 200)

    End Sub


    3 - Call the procedure "TestListButtonPicturesAndIDs". A new command bar will be created with all faceid between 100 and 200, with the especific number as tooltip. Change the range values in ListButtonPicturesAndIDs, to display more images. The autor says there are literally thousands of available images that differ with each Office application. More information see:

    http://msdn.microsoft.com/library/de...ce04042002.asp
    Regards,

    Rogerio

  3. #3
    Join Date
    Oct 2002
    Posts
    6
    Thank you very much, it works perfectly!!

    I've found another way.. a bit more comfortable, but it is a macro for an excel worksheet (but the IDs are the same like in access).

    I get an error everytime i start this macro, and excel 2002 closes automatically, but the worksheet can be restored and the icons and IDs are available.



    '**************************
    'written by Silvia Widmer
    'translated by Hendrik T. Schulz
    '
    Dim cbb As CommandBarButton, ComBar As CommandBar, cbc As CommandBarControl


    Sub CommandBarFaceIDListe()

    Dim a, b
    Application.DisplayAlerts = False
    Sheets(3).Delete
    Application.DisplayAlerts = True
    Sheets.Add after:=Sheets(2)
    ThisWorkbook.Sheets(3).Activate
    Application.ScreenUpdating = False
    For Each ComBar In Application.CommandBars
    If ComBar.Name = "test" Then ComBar.Delete
    Next
    On Error Resume Next
    Set ComBar = Application.CommandBars.Add(Name:="test", Position:=msoBarTop)
    Set cbb = ComBar.Controls.Add(ID:=1)
    b = 0
    For a = 1 To 3518
    With cbb
    .FaceId = a
    .CopyFace
    End With
    ThisWorkbook.Sheets(3).Activate
    With ThisWorkbook.Sheets(3)
    .Cells((a Mod 100) + 1, (a \ 100) + b + 1).Formula = a
    .Cells((a Mod 100) + 1, (a \ 100) + b + 2).Select
    .Paste
    End With
    If (a + 1) Mod 100 = 0 Then b = b + 1
    Report "Create Face-Id-Listing", a
    Next a
    For i = 1 To (a / 100 + 1) * 2
    Select Case i Mod 3
    Case 1: w = 4
    Case 0: w = 5
    End Select
    Columns(i).Select
    Selection.ColumnWidth = w
    Next i
    On Error Resume Next
    ThisWorkbook.Sheets(3).Name = "Symbols (Face-ID's)"
    Cells(1, 1).Activate
    Report "Create Face-Id-Listing", 99999
    Application.ScreenUpdating = True
    End Sub

    Private Sub Report(tText, tCount)

    Select Case tCount
    Case 0
    Application.StatusBar = tText + " - Please wait..."
    Case 99999
    Application.StatusBar = tText + " - Finished."
    Case Else
    Application.StatusBar = CStr(tCount) + " " + tText + " - please wait..."
    End Select
    DoEvents
    End Sub
    Last edited by HTS; 10-28-02 at 03:45.

Posting Permissions

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