Hello!
I'm making VSTO add-in (VS2008) for helpdesk. I'm trying to customize Ribbon
on load "read email" inspector.
I have ready code, but I'm trying to do something like that:
When email is comming with subject "Opened entry" i want to display
RibbonGroup "New Call" with button "New"
When email will have subject "Call Update" i want to display only
RibbonGroup "Update Call" with button "Update"
I thought, that I can do this in OnLoad metod in Ribbon. But I'm getting
"Object is not set to an instance of an object". So it looks, like inspector
is not exist at this moment. But inspector is starting my ribbon. Maybe
someone have solution for this?
Piece of code from OnLoad:
Dim ol As New Microsoft.Office.Interop.Outlook.Application()
Dim NewMail As poczta.MailItem
NewMail = ol.ActiveInspector.CurrentItem
If NewMail.Subject.Contains("Opened entry") Then
grpUpdateRibbGroup.visible = false
End if
Ken Slovak - [MVP - Outlook] - 19 Mar 2008 15:21 GMT
You would need to use callbacks such as getEnabled and getVisible for
something like that. When your Inspector fires its first
Inspector.Activate() event you can call ribbon.Invalidate() to force the
getEnabled and getVisible callbacks to fire and then you can check the
subject using control.Context to get the Inspector and using
Inspector.CurrentItem to get the subject. Then you can return true or false
in the getEnabled and getVisible callbacks as desired to set the visibility
of your controls.

Signature
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
> Hello!
>
[quoted text clipped - 23 lines]
> grpUpdateRibbGroup.visible = false
> End if