Atravis
08-19-2010, 03:40 AM
I found this code online for faceids;
Sub MakeAllFaceIDs()
'make 14 toolbars, with 300 faces each
'note that maxid is greater than last valid ID, so error will
'occur when first invalid ID is used
Const maxId = 3900
On Error GoTo realMax
For bars = 0 To 13
firstId = bars * 300
lastId = firstId + 299
Set tb = CommandBars.Add
For I = firstId To lastId
Set btn = tb.Controls.Add
btn.FaceId = I
btn.TooltipText = "Faceid = " & I
Next
tb.Name = ("Faces " & CStr(firstId) & " to " & CStr(lastId))
tb.Width = 591
tb.Visible = True
Next
'Delete the button that caused the error and set toolbar name
realMax:
btn.Delete
tb.Name = ("Faces " & CStr(firstId) & " to " & CStr(I - 1))
tb.Width = 591
tb.Visible = True
End Sub
I would ideally like to be able to use one of the images used in the face IDs (in particular number 1550) as the image on a command button but can't seem to find a way of calling the image in a way that allows it to be used like this. Is there anyway of doing this?
Thanks.
Sub MakeAllFaceIDs()
'make 14 toolbars, with 300 faces each
'note that maxid is greater than last valid ID, so error will
'occur when first invalid ID is used
Const maxId = 3900
On Error GoTo realMax
For bars = 0 To 13
firstId = bars * 300
lastId = firstId + 299
Set tb = CommandBars.Add
For I = firstId To lastId
Set btn = tb.Controls.Add
btn.FaceId = I
btn.TooltipText = "Faceid = " & I
Next
tb.Name = ("Faces " & CStr(firstId) & " to " & CStr(lastId))
tb.Width = 591
tb.Visible = True
Next
'Delete the button that caused the error and set toolbar name
realMax:
btn.Delete
tb.Name = ("Faces " & CStr(firstId) & " to " & CStr(I - 1))
tb.Width = 591
tb.Visible = True
End Sub
I would ideally like to be able to use one of the images used in the face IDs (in particular number 1550) as the image on a command button but can't seem to find a way of calling the image in a way that allows it to be used like this. Is there anyway of doing this?
Thanks.