Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / VS Tools for Office / March 2008

Tip: Looking for answers? Try searching our database.

Problem with customizong ribbon in Outlook 2007 OnLoad

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Leszek Gruszka - 18 Mar 2008 16:47 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.