![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I have googled around a bit and haven't found what I need.
I am coding in C#, not VB. Outlook 2002 and above. I have some New Mail, Reply buttons. I only want to enable these at the same time Outlook enables the proper ones. So if they change folders to Today or Calendar, I would like to remove the buttons I have added. I can't figure out which event I should be registering for? And, assuming an event, which property should I check to determine if: 1. I am viewing mail items 2. One is selected (otherwise I want to disable Reply) 3. If the Calendar has been selected 4. If Notes are active, since I will also want to do something similar with Notes. Looking for some examples, so if you are aware of any code snippets (VB if C# note available) that do this kind of thing, point them out to me. Much appreciated. Dave |
Ads |
#2
|
|||
|
|||
![]()
This is for an Explorer window (folder view) only?
Use ActiveExplorer.CurrentFolder to determine what folder is being displayed and what type it is. Outlook.MAPIFolder folder = (Outlook.MAPIFolder) appOL.ActiveExplorer().CurrentFolder; if(folder.DefaultItemType == OlItemType.olMailItem) { // it's a mail folder // for a calendar folder // if folder.DefaultItemType == OlItemType.olAppointmentItem } int itemsSelected = folder.Selection.Count; Don't try to do much with Notes, they're brain dead. Never, ever try to add a UI to an open Note Inspector. The event to register for is Explorer.CommandBars.OnUpdate(). The ActiveExplorer() is the one you want to use. However, that's an expensive event to handle, it fires all the time. It also fires multiple times for just one change and when buttons are being disabled you can expect it to fire many times. That event passes no in arguments so you will have to monitor certain CommandBarButton objects to check their Enabled state. The CommandBar objects are in the Office tlb. You also have to be aware that there is no deterministic way to know when your handler for the event will fire relative to when the buttons such as Reply are disabled. You will have to test for that and possibly handle a few test cases. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "David" wrote in message news ![]() I have googled around a bit and haven't found what I need. I am coding in C#, not VB. Outlook 2002 and above. I have some New Mail, Reply buttons. I only want to enable these at the same time Outlook enables the proper ones. So if they change folders to Today or Calendar, I would like to remove the buttons I have added. I can't figure out which event I should be registering for? And, assuming an event, which property should I check to determine if: 1. I am viewing mail items 2. One is selected (otherwise I want to disable Reply) 3. If the Calendar has been selected 4. If Notes are active, since I will also want to do something similar with Notes. Looking for some examples, so if you are aware of any code snippets (VB if C# note available) that do this kind of thing, point them out to me. Much appreciated. Dave |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Changing RTF Body on MailItem Read event | [email protected] | Add-ins for Outlook | 3 | September 13th 06 07:30 PM |
Changing a Column in Multiple Folders Simultaneously | JerryZ | Outlook - Installation | 1 | August 11th 06 08:27 PM |
changing reoccuring event timezones.. | Adam | Outlook - Calandaring | 0 | August 11th 06 07:45 AM |
Changing View For Public Folders | [email protected] | Outlook - General Queries | 1 | August 11th 06 04:09 AM |
changing column views in folders | MG | Outlook Express | 1 | April 24th 06 03:26 PM |