A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Adding image to Outlook commandbar button



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 1st 07, 08:54 AM posted to microsoft.public.outlook.program_addins
saturn
external usenet poster
 
Posts: 3
Default Adding image to Outlook commandbar button

I am writing a VC++ application where I have to add a commandbar and a
button to commandbar on any new inspector window. I have successfully
added the commandbar and button to my commandbar. I have done these in
a handler of New Inspector.

Now I am stuck with following issues:
1. I have to add an image to my button added to the commandbar. How
can I do this in VC++?
2. How do I register a handler for my button click?
3. Is there any property of commandbar through which I can uniquely
identify it? This will help in making decision of adding commandbar if
already not present.

Any pointers on these will be very helpful.

Regards,
Pradeep

Ads
  #2  
Old August 1st 07, 01:59 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Adding image to Outlook commandbar button

Please do not multipost. I answered your question in
developer.outlook.addins.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"saturn" wrote in message
oups.com...
I am writing a VC++ application where I have to add a commandbar and a
button to commandbar on any new inspector window. I have successfully
added the commandbar and button to my commandbar. I have done these in
a handler of New Inspector.

Now I am stuck with following issues:
1. I have to add an image to my button added to the commandbar. How
can I do this in VC++?
2. How do I register a handler for my button click?
3. Is there any property of commandbar through which I can uniquely
identify it? This will help in making decision of adding commandbar if
already not present.

Any pointers on these will be very helpful.

Regards,
Pradeep


  #3  
Old August 3rd 07, 01:57 PM posted to microsoft.public.outlook.program_addins
saturn
external usenet poster
 
Posts: 3
Default Adding image to Outlook commandbar button

Now I am able to trap the click of my button. But the callback
function receives CommandBarButton. Using this how I can identify the
inspector on which the button was clicked? How suitable is to conside
the active window?

Regards,
Pradeep

  #4  
Old August 3rd 07, 02:13 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Adding image to Outlook commandbar button

ActiveInspector usually works, but not always.

The best practice is to construct a unique Tag property for each button you
create. I usually use a GUID or unique string value with a Key value
assigned to each open Inspector. The key value gets incremented each time an
Inspector is opened. That key is stored in a public property in the
Inspector wrapper class so it's accessible. I make up the tag value with the
GUID and key, then when a Click occurs it will only occur in that wrapper
class in the Click event handler inside that class.

If you don't use a unique Tag then Click will fire in every single open
Inspector, so if you're handling Click in one place and there are 3 open
Inspectors then you'll get 3 click events firing. Using Inspector wrappers
is another best practice, as is using Explorer wrappers to handle open
Explorers.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"saturn" wrote in message
oups.com...
Now I am able to trap the click of my button. But the callback
function receives CommandBarButton. Using this how I can identify the
inspector on which the button was clicked? How suitable is to conside
the active window?

Regards,
Pradeep


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
outlook 2007- image in custom button lencastro Outlook - General Queries 1 January 24th 07 01:16 PM
Adding button to New Message Window Joshua Ellul Add-ins for Outlook 5 March 22nd 06 01:10 PM
Adding a button to the Appointment Form [email protected] Add-ins for Outlook 6 March 21st 06 02:09 PM
how to add a custom button on the explorer "standard" commandbar Herve cadieu Outlook and VBA 1 March 17th 06 03:33 PM
Adding a 2nd button (functionality not working) Newt Outlook and VBA 3 March 6th 06 05:35 PM


All times are GMT +1. The time now is 09:22 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.