Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Add-ins for Outlook (http://www.outlookbanter.com/add-ins-outlook/)
-   -   Application.ActiveInspector() is Null on Ribbon Load (http://www.outlookbanter.com/add-ins-outlook/90917-application-activeinspector-null-ribbon-load.html)

Deepak N May 28th 09 07:32 AM

Application.ActiveInspector() is Null on Ribbon Load
 
Is it possible to access the ActiveInspector at the time of ribbon load. Application.ActiveInspector() return proper value when i use custom form but not working for default contact form.

Actually i want to customize ribbon button depending on a property value in ActiveInspector().CurrentItem.
Submitted using http://www.outlookforums.com

Ken Slovak - [MVP - Outlook] May 28th 09 02:19 PM

Application.ActiveInspector() is Null on Ribbon Load
 
Customize the ribbon in what way?

The callback for ribbon XML is made only on the first opening of that type
of Outlook item. So the first time a contact is opened the ribbon callback
is called and you return the XML for a contact item ribbon.

What I'd do would be to handle the Inspector.Activate() event. In the first
Activate() event I'd make a ribbon.Invalidate() call, where ribbon is an
object variable for your IRibbonUI instance.

The Invalidate() call will fire any callbacks you have set up in the XML for
visible and enabled, among other things. You can use those callbacks to get
the ActiveInspector().CurrentItem and read its properties, then decide which
ribbon UI you want to show/hide/enable/disable.

If you have dynamic controls such as a dynamicMenu you can also populate the
control as desired at that point from those callbacks.

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


"Deepak N" endeep123[at]gmail[dot]com wrote in message
...
Is it possible to access the ActiveInspector at the time of ribbon load.
Application.ActiveInspector() return proper value when i use custom form
but not working for default contact form.

Actually i want to customize ribbon button depending on a property value
in ActiveInspector().CurrentItem. Submitted using
http://www.outlookforums.com




All times are GMT +1. The time now is 10:43 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com