Ulf Nilsson was telling us:
Ulf Nilsson nous racontait que :
> Hi,
>
> I want to create a toolbar using vba (because I do not know how to
> manually add a toolbar with Office XP Developer in an dll). How do I
> add my own images on the buttons? I know how to do it with dot-files
> and that way does not apply with dll-files.
You need to et the bitmap in the clipboard. TO do that, you must have the
bitmap available somewhere. I do not think you can get it from an already
existing userform button. Once the userform is created, you cannot extract
the image from a control... well, at least I have never seen it done.
> How do I copy an image from a button in a form to the clipboard?
> Copy/PasteFace does only apply to CommandBarButton. My question is
> about forms.
and toolbars as stated in your subject line: "Copy image from form to
toolbar"
I think you are going to have to use Jonathan's idea about keeping a toolbar
around as a source of button images.
> / Ulf
>
[quoted text clipped - 21 lines]
>> Keep your VBA code safe, sign the ClassicVB petition
>> www.classicvb.org

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Ulf Nilsson - 12 Jul 2005 13:57 GMT
Hi Jean-Guy and Jonathan,
I almost gave up finding any solution to my problem, BUT have found the
following solution (in a two years old document). I think I did not explain
my problem in a understandable way for you.
'***On startup
Dim cbToolbarOffice As Office.CommandBar
Dim picUpdate As IPictureDisp
Set picUpdate = stdole.StdFunctions.LoadPicture("C:\Temp\Update.bmp")
Set cbToolbarOffice = appHostApp.CommandBars.Add(Name:="AV", _
Position:=msoBarTop)
'***Buttons on the toolbar
Set cmbUpdate = cbToolbarOffice.Controls.Add(Type:=msoControlButton, _
Parameter:="AV_Toolbar")
With cmbUpdate
.Style = msoPicture
.Caption = "&The List"
.Picture = picUpdate
.TooltipText = "Show the list"
End With
Instead of "FaceId", I used "Picture" and it works.
Thanks both of you for your advice and patient.
/ Ulf
> Ulf Nilsson was telling us:
> Ulf Nilsson nous racontait que :
[quoted text clipped - 46 lines]
> >> Keep your VBA code safe, sign the ClassicVB petition
> >> www.classicvb.org