![]() |
| 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. |
|
|||||||
| Tags: adding, button, inspector, problem, strange, while, window |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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 | |
|
|
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 06:16 AM |
| Adding button to New Message Window | Joshua Ellul | Add-ins for Outlook | 5 | March 22nd 06 01:10 PM |
| how to add commandbarbutton to inspector window | Ram | Outlook and VBA | 0 | January 19th 06 06:07 AM |
| how to add commandbarbutton to inspector window | Ram | Outlook - General Queries | 1 | January 18th 06 08:42 PM |
| how to add commandbarbutton to inspector window | Ram | Add-ins for Outlook | 0 | January 18th 06 03:18 PM |