Bitmap on toolbar

F

FredGill

I've also posted this on outlook.add-ins:


Hi,
I've created an addin that puts a button on the "standard" toolbar (see
code below) using the clipboard - as this is the only way I could get it
working. The side-effect of this is that the clipboard is cleared - is
there a better way of getting my resource bitmap as the button image?

regards
Fred



Clipboard.Clear
Clipboard.SetData LoadResPicture(IIf(ToggleEnabled, 101, 102),
vbResBitmap) 'depends on enabled or not!!!!

'Attach our button to the Standard menu bar
Set ToggleBtn =
objInsp.CommandBars("Standard").Controls.Add(Type:=msoControlButton,
Temporary:=True)
With ToggleBtn
.Style = msoButtonIcon
.PasteFace
.Enabled = True
.ToolTipText = LoadResString(150)
End With
 
G

Gord Cody

If you are using vb then the only way i know is
to do exactly as you have done (using the clipboard)
if you were using c++ you would not have this problem

I had to do the same thing

I recommend that you also clear the clipboard after
you are done using it so that people will not
inadvertently paste your button into their email :)

You should also check out my earler post to this group
June 19, unfortunately I have yet to see any responses ...

Gord C
 
S

silu.h

hi!

where can i find a fully example in c# for adding a bitmap in the toolbar?
it would be very helpful...

thanks a lot,
Silu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top