ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Inserting a Face ID onto a Command button (https://www.excelbanter.com/excel-programming/291120-inserting-face-id-onto-command-button.html)

Denny Behnfeldt

Inserting a Face ID onto a Command button
 
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



Vasant Nanavati

Inserting a Face ID onto a Command button
 
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.

--

Vasant


"Denny Behnfeldt" wrote in message
...
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





Charles

Inserting a Face ID onto a Command button
 
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


---
Message posted from http://www.ExcelForum.com/


Doug Glancy

Inserting a Face ID onto a Command button
 
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

"Denny Behnfeldt" wrote in message
...
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





onedaywhen

Inserting a Face ID onto a Command button
 
"Doug Glancy" wrote in message ...

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.

--

Tom Ogilvy

Inserting a Face ID onto a Command button
 
You have received good advice on getting an ID into the clipboard.
To get the picture from the clipboard to the control in code, you might have
a look at Stephen Bullen's PastePicture file

http://www.bmsltd.ie/Excel/Default.htm

It is a little over half way down the page.

--
Regards,
Tom Ogilvy


"Denny Behnfeldt" wrote in message
...
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






All times are GMT +1. The time now is 10:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com