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

Tags: , , , , , ,

strange problem while adding button to inspector window





 
 
Thread Tools Display Modes
  #1  
Old May 13th 08, 04:42 PM posted to microsoft.public.outlook.program_addins
vidishasharma@gmail.com
external usenet poster
 
Posts: 11
Default strange problem while adding button to inspector window

Hi,

In was trying to add button in inspector window. I
used .InspectorsEvents_NewInspectorEventHandler(myInspe ctors_NewInspector);
event and in this event I called a wrapper class where I configured
ItemEvents_10_OpenEventHandler(myMailItem_Open);

In this event I tried to create a button.

The problem over here is the button does not get created. However,
when I click on reply to this mail a new inspector is opened up where
I can reply to my mail and then a button on the reading inspector is
added.

I do not understand why this is happening.
Ads
  #2  
Old May 13th 08, 05:40 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 3,736
Default strange problem while adding button to inspector window

NewInspector is not a good event in which to create CommandBar UI. Depending
on the Outlook version and whether it's a WordMail object or not the
CommandBars collection of the Inspector may or may not be completely
instantiated in that event handler. In Outlook 2007 you explicitly get a
weak object reference to Inspector in NewInspector, in which many properties
of the Inspector or Inspector.CurrentItem aren't fully exposed to you yet.

I always create any UI for an Inspector in the first Inspector.Activate()
event that fires. At that time all UI elements are fully instantiated and
exposed to you.

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


wrote in message
...
Hi,

In was trying to add button in inspector window. I
used
.InspectorsEvents_NewInspectorEventHandler(myInspe ctors_NewInspector);
event and in this event I called a wrapper class where I configured
ItemEvents_10_OpenEventHandler(myMailItem_Open);

In this event I tried to create a button.

The problem over here is the button does not get created. However,
when I click on reply to this mail a new inspector is opened up where
I can reply to my mail and then a button on the reading inspector is
added.

I do not understand why this is happening.


  #3  
Old May 14th 08, 07:38 AM posted to microsoft.public.outlook.program_addins
vidishasharma@gmail.com
external usenet poster
 
Posts: 11
Default strange problem while adding button to inspector window

Hi Ken,

Thanks for answering my question.

I am trying to add win32 button next to 'to:' when you read a mail in
an inspector (same way I did for reading pane)

In my
InspectorsEvents_NewInspectorEventHandler(myInspec tors_NewInspector)

I registered the following event
((Ol.InspectorEvents_Event)Inspector).Activate+=ne w
Microsoft.Office.Interop.Outlook.InspectorEvents_A ctivateEventHandler(Connect_Activate);

however In Connect_Activate() I find that
applicationObject.ActiveInspector() is still 'null' means my inspector
is not activated and therefore button does not get added

when I try to reply that mail applicationObject.ActiveInspector() has
valid value as now the inspector where we read our mail is active and
therefore the button gets added in that inspector.

I tried the same thing in
((Ol.InspectorClass)Inspector).InspectorEvents_10_ Event_Activate +=
new
Microsoft.Office.Interop.Outlook.InspectorEvents_1 0_ActivateEventHandler(Connect_InspectorEvents_10_ Event_Activate);

however no luck. Can you guide what is wrong I am doing....



  #4  
Old May 14th 08, 10:58 AM posted to microsoft.public.outlook.program_addins
vidishasharma@gmail.com
external usenet poster
 
Posts: 11
Default strange problem while adding button to inspector window

I was able to solve this.

when the NewInspector event is registered
myInspectors.NewInspector += new
Microsoft.Office.Interop.Outlook.InspectorsEvents_ NewInspectorEventHandler(myInspectors_NewInspector );

the following is created
myInspectors_NewInspector(Microsoft.Office.Interop .Outlook.Inspector
Inspector)
{}

I used Inspector insted of applicationObject.ActiveInspector() and
that in
((Ol.InspectorClass)Inspector).InspectorEvents_10_ Event_Activate +=
new
Microsoft.Office.Interop.Outlook.InspectorEvents_1 0_ActivateEventHandler(Co*
nnect_InspectorEvents_10_Event_Activate);

and that did the charm.

Thanks Ken for your suggestion.



  #5  
Old May 14th 08, 03:23 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 3,736
Default strange problem while adding button to inspector window

Why would you need to grab ActiveInspector() in the Inspector.Activate()
event? You already know what Inspector it is. Just use the Inspector that
fired the Activate() event. Or am I missing something?

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


wrote in message
...
Hi Ken,

Thanks for answering my question.

I am trying to add win32 button next to 'to:' when you read a mail in
an inspector (same way I did for reading pane)

In my
InspectorsEvents_NewInspectorEventHandler(myInspec tors_NewInspector)

I registered the following event
((Ol.InspectorEvents_Event)Inspector).Activate+=ne w
Microsoft.Office.Interop.Outlook.InspectorEvents_A ctivateEventHandler(Connect_Activate);

however In Connect_Activate() I find that
applicationObject.ActiveInspector() is still 'null' means my inspector
is not activated and therefore button does not get added

when I try to reply that mail applicationObject.ActiveInspector() has
valid value as now the inspector where we read our mail is active and
therefore the button gets added in that inspector.

I tried the same thing in
((Ol.InspectorClass)Inspector).InspectorEvents_10_ Event_Activate +=
new
Microsoft.Office.Interop.Outlook.InspectorEvents_1 0_ActivateEventHandler(Connect_InspectorEvents_10_ Event_Activate);

however no luck. Can you guide what is wrong I am doing....




  #6  
Old May 15th 08, 04:04 PM posted to microsoft.public.outlook.program_addins
vidishasharma@gmail.com
external usenet poster
 
Posts: 11
Default strange problem while adding button to inspector window

When I register
((Ol.InspectorEvents_Event)Inspector).Activate+=ne w
Microsoft.Office.Interop.Outlook.InspectorEvents_A ctivateEventHandler(Connect_Activate);


Following method is craeted

void Connect_Activate()
{}

This has no defination for inspector there in new inspector wher I get
my current inspector I used that inspector object insted.

Let me know if I am know in implementing things.
  #7  
Old May 16th 08, 03:27 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 3,736
Default strange problem while adding button to inspector window

If you use Inspector wrapper classes as has been recommended then each
wrapper class has an Inspector object that's set when you create the wrapper
class instance in NewInspector. You use your constructor code for that
wrapper class to set the Inspector object and to add your event handlers.
When Activate() fires it fires only in that one wrapper class, therefore the
Inspector object in that wrapper class is the one you're handling events
for.

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


wrote in message
...
When I register
((Ol.InspectorEvents_Event)Inspector).Activate+=ne w
Microsoft.Office.Interop.Outlook.InspectorEvents_A ctivateEventHandler(Connect_Activate);


Following method is craeted

void Connect_Activate()
{}

This has no defination for inspector there in new inspector wher I get
my current inspector I used that inspector object insted.

Let me know if I am know in implementing things.


 




Thread Tools
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
adding coomand bar buttons to inspector window Ram Add-ins for Outlook 4 May 26th 06 07:16 AM
Adding button to New Message Window Joshua Ellul Add-ins for Outlook 5 March 22nd 06 02:10 PM
how to add commandbarbutton to inspector window Ram Outlook and VBA 0 January 19th 06 07:07 AM
how to add commandbarbutton to inspector window Ram Outlook - General Queries 1 January 18th 06 09:42 PM
how to add commandbarbutton to inspector window Ram Add-ins for Outlook 0 January 18th 06 04:18 PM


All times are GMT +1. The time now is 01:51 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2008 Outlook Banter, part of the NewsgroupBanter project.
The comments are property of their posters.
Mortgages - Video game rental - Mobile Phones - Buy Anything On eBay - Loans