PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook Program Addins Button image on toolbar

Reply

Button image on toolbar

 
Thread Tools Rate Thread
Old 30-06-2003, 12:44 PM   #1
FredGill
Guest
 
Posts: n/a
Default Button image on toolbar


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

--
Direct access to this group with http://web2news.com
http://web2news.com/?microsoft.publ....program_addins
  Reply With Quote
Old 30-06-2003, 10:04 PM   #2
Dmitry Streblechenko
Guest
 
Posts: n/a
Default Re: Button image on toolbar

In Outlook 2002 and up, you can use the Picture and Mask properties.
Otherwise your only choice is restoring the clipboard. For a Delphi sample,
see the Babelfish addin source code on my site (uSaveClipboard.pas file).

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


"FredGill" <fredgill.news.invalid@web2news.net> wrote in message
news:45972N683@web2news.com...
> 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
>
> --
> Direct access to this group with http://web2news.com
> http://web2news.com/?microsoft.publ....program_addins



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off