Inserting a Face ID onto a Command button

  • Thread starter Thread starter Denny Behnfeldt
  • Start date Start date
D

Denny Behnfeldt

I need to insert a Face ID onto a Command Button that'son a Userform. I know
the number (1106), but have not figured out how to put it onto the control?
Ideas?
Thanks for the help in advance!
Denny
 
I believe that you would have to copy the image from the ToolbarButton and
then paste it onto the CommandButton, since the latter does not have a
FaceID property. It may be possible to get a FaceID into the Clipboard using
APIs, but I don't know offhand how to go about it.
 
Denny,

Select the command buton you want and in the property window selet the
Picture property and click on the three dots. if you have a picture
folder ( or find your picture folder)open it and select the picture you
want.

HTh

charles
 
Denny,

I've tried to tie together the two previous answers and this is what I came
up with:

This macro temporarily creates a toolbar and a button on it with faceid
#1106. The copyface command then puts the faceid onto the clipboard. Then
the temporary toolbar is deleted. From there you can paste the faceid into
the picture property box as described in Charles' answer to your post. I'm
not sure the error handling is correct, but I was trying to make sure the
toolbar is deleted no matter what. Tested in XL 2000:

Sub test()

Dim cbar As CommandBar
Dim cbarbutton As CommandBarButton

On Error GoTo err_handler

Set cbar = CommandBars.Add
Set cbarbutton = cbar.Controls.Add
With cbarbutton
.FaceId = 1106
.CopyFace
End With

err_handler:
If Not cbar Is Nothing Then
cbar.Delete
End If

End Sub

hth,

Doug
 
Doug Glancy said:
macro temporarily creates a toolbar and a button on it with faceid
#1106. The copyface command then puts the faceid onto the clipboard. Then
the temporary toolbar is deleted. From there you can paste the faceid into
the picture property box as described in Charles' answer to your post.

Or you could at this point persist it e.g. open Paint, choose paste
and save the image to disk.

--
 
Back
Top