5 Replies Latest reply on Apr 8, 2016 9:17 AM by pthivierge

    ProcessBook FaceID list

    Al_Gagnon

      Does anyone know where I can find a list of FaceIDs for processbook?

        • Re: ProcessBook FaceID list
          Kenji Hashimoto

          Do you mean toolbar's button's FaceID?

          I am not sure it is what you want but I run following macro and get the FaceID results.

          Sub test()
          Dim Toolbar As PBCommandBar
          Dim Item As Variant
          Dim list As String
          For Each Toolbar In Application.CommandBars
              For Each Item In Toolbar.Controls
              If Item.Type = "1" Then
              list = list & Item.Caption & " : FaceID : " & Item.FaceId & vbCrLf
              End If
              Next
          Next
          MsgBox (list)
          End Sub
          
          

          Sorry that the captions are in Japanese. Is this what you want?

          1 of 1 people found this helpful
            • Re: ProcessBook FaceID list
              gregor

              Hello Al,

               

              Thank you for this question. When I saw it yesterday evening my reaction was like "By Toutatis! What is a FaceID?"

               

              I had never heard this term but a brief research showed FaceID's are used with CommandButtons in ProcessBook and are actually a very useful way to assign a predefined icon. Unfortunately I wasn't able to locate a list of FaceID's used in ProcessBook.

               

              The sample code provided by Kenji is useful. It iterates through the open Toolbars and reads the definition of the existing buttons but it doesn't allow to list the FaceID's that are not referenced. To fill that gap, I have created a Display and added a few lines of VBA code that allow to create or select a Toolbar by name and to specify a range of FaceID's. Another button starts adding new buttons, assigning the FaceID's and also changing the ToolTip, so the FaceID shows when hovering the mouse over the button.

               

              Caution: Please be stingy with "new" toolbar names. You will find them under View -> Toolbars and it's possible to delete them. Again, please be careful.

               

              Dim tbName As String
              Private Sub CommandButton1_Click()
                  tbName = TextBox1.Text
                  Dim toolBar As PBCommandBar
                  Dim bExist As Boolean
                  bExist = False
                  For Each toolBar In Application.CommandBars
                      If toolBar.Name = tbName Then bExist = True
                  Next
                  If bExist = False Then
                      Set toolBar = Application.CommandBars.Add(tbName, 1, False, False)
                      toolBar.Visible = True
                  End If
              End Sub
              Private Sub CommandButton2_Click()
                  Dim toolBar As PBCommandBar
                  Dim cmdButton As PBCommandBarButton
                  Dim iSta As Long
                  Dim iEnd As Long
                  Dim i As Long
                  iSta = CLng(TextBox2.Text)
                  iEnd = CLng(TextBox3.Text)
                  Set toolBar = Application.CommandBars(tbName)
                  For i = iSta To iEnd
                      Set cmdButton = toolBar.Controls.Add(pbControlButton)
                      cmdButton.Style = pbButtonIcon
                      cmdButton.FaceId = i
                      cmdButton.ToolTipText = Str(i)
                  Next i
              End Sub
              
              2 of 2 people found this helpful
            • Re: ProcessBook FaceID list
              Al_Gagnon

              So now that Ive been able to find some of the IDs, thanks to you guys, I've noticed that I am unable to add a FaceId to a Control Button, which is part of the menu rather than a tool bar. 

               

              In the VBA Editor, the FaceId property actually gets changed to Faceid (*notice the lowercase i).  I can get the item added to the menu, just no icon associated.

               

              Anyone else have this problem?

               

              Here is the code, youll need a variable called ToolName for your menu name :

              code.jpg

                • Re: ProcessBook FaceID list
                  Kenji Hashimoto

                  I've checked the code and found that cbbutton's Type = IDualCommandBarButton.

                  It seems like this object regects Set faceid from VBA code.

                  I think that it is difficult to set faceid to IDualCommandBarButton.

                  • Re: ProcessBook FaceID list
                    pthivierge

                    Hello Al,

                     

                    You may look: Pictures On CommandBar Items

                    I don't know if this is gonna work for you I did not test it, but this guys has a quite good website on VBA in general.

                    You can probably derive his embeded image strategy with a bitmap object hidden on the PB .PDI.

                     

                    I am also wondering why you want to stick with PB icons?

                    if you can, just pic some icons specifically for your application that will not interfere and confuse the user with existing functions in PB.

                    For instance, this site has a ton of cool icons.

                     

                    Hope this helps,