A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How to hide/disable send button in Outlook 2007



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 11th 09, 08:33 AM posted to microsoft.public.outlook.program_forms
jubergolandaj
external usenet poster
 
Posts: 3
Default How to hide/disable send button in Outlook 2007

I am working on Outlook 2007 Add-in developed in C# and VS-2008. In this we
are having our own custom form .oftOn this form we have our custom “Send”
button on click event of it our processing continues. Now the problem we are
facing is we want to disable or hide the built-in send button of Outlook on
the Ribbon. Also we want to disable or hide some groups in the Tabs on
Ribbon. We have tried to do this by using custom Ribbon class implementing
Office.Core.IRibbonExtensibility interface.In ThisAddin file we have written
the following method: protected override
Microsoft.Office.Core.IRibbonExtensibility
CreateRibbonExtensibilityObject(){return new Ribbon(); }In Ribbon class the
xml file is referred which disable the particular groups from ribbon tab.But
this is applied to all the new mail items not only to my custom form. Or at
least other best option we can see is, catch the send button click event of
outlook and with that we need "Alt+S" and "Cntrl+Enter" event also. Is it
possible?
  #2  
Old August 11th 09, 03:09 PM posted to microsoft.public.outlook.program_forms
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default How to hide/disable send button in Outlook 2007

When Outlook asks for the ribbon XML in GetCustomUI() it can only ask for
mail.read or mail.compose. There's no provision in that callback for custom
forms and the callback occurs only once on the first item of that type
that's opened. So you need a different approach.

If you handle Inspectors.NewInspector() you can instantiate an instance of
an Inspector object for only the types of items you want to handle, for
example mail items. You can use reflection to get the Class of the weak
object reference for Inspector.CurrentItem and test it for being olMail.

Then set up that Inspector object or Inspector wrapper class to handle the
Inspector.Activate() event. In that event call ribbon.Invalidate().

If instead of hard disabling the built-in ribbon commands using
enable="false" you can set the XML to call back to your getVisible and
getEnabled callbacks. Calling Invalidate() will fire those callbacks, Since
control.Context will be your Inspector in those callbacks you can cast that
to an Inspector, check for Inspector.CurrentItem.MessageClass and return
values in the getVisible and getEnabled callbacks based on what MessageClass
is returned. Your custom UI can be enabled/disabled using the same logic.

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


"jubergolandaj" wrote in message
...
I am working on Outlook 2007 Add-in developed in C# and VS-2008. In this we
are having our own custom form .oftOn this form we have our custom “Send”
button on click event of it our processing continues. Now the problem we
are
facing is we want to disable or hide the built-in send button of Outlook
on
the Ribbon. Also we want to disable or hide some groups in the Tabs on
Ribbon. We have tried to do this by using custom Ribbon class implementing
Office.Core.IRibbonExtensibility interface.In ThisAddin file we have
written
the following method: protected override
Microsoft.Office.Core.IRibbonExtensibility
CreateRibbonExtensibilityObject(){return new Ribbon(); }In Ribbon class
the
xml file is referred which disable the particular groups from ribbon
tab.But
this is applied to all the new mail items not only to my custom form. Or
at
least other best option we can see is, catch the send button click event
of
outlook and with that we need "Alt+S" and "Cntrl+Enter" event also. Is it
possible?


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Disable Send/Receive" button Ken Isaacson Outlook - General Queries 7 January 12th 09 12:41 PM
Disable button from addins Outlook 2007 Andrey_R Add-ins for Outlook 2 April 2nd 08 07:12 PM
Hide Send/Receive button in Standard Toolbar - Outlook 2003 Aaron Hammond Outlook - Installation 3 June 5th 07 12:34 PM
Outlook 2007 SEND button behavior Burton Roberts Outlook - General Queries 1 May 10th 07 03:19 PM
Where is the send letter to contact button in Outlook 2007? david76 Outlook - Using Contacts 1 November 3rd 06 09:49 PM


All times are GMT +1. The time now is 12:28 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-2025 Outlook Banter.
The comments are property of their posters.