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 and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Override the 'To' Button in Outlook



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 19th 09, 11:24 AM posted to microsoft.public.outlook.program_vba
Zengfu Xu
external usenet poster
 
Posts: 3
Default Override the 'To' Button in Outlook

Hi,

I want to override the 'To' button click event in Outlook so that user can
select
a right contact from the list of contact in the organisation other than the
contacts stored in Outlook. Can any one tell me if we can override the 'To'
button click event
using VB so that it would do what we want? If so then how?

Many thnaks!

Zengfu Xu
--
Software Developer
Office Automation
Ads
  #2  
Old May 19th 09, 03:11 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Override the 'To' Button in Outlook

No. That dialog opening event isn't exposed anywhere. You'd have to use
Win32 API calls and callbacks to handle the dialog window opening and send
it a WM_CLOSE message, then you'd have to provide your own dialog in its
place.

You could handle the PropertyChange() event on the item to trap when a
selection is made from the To dialog, but that would be after the fact.

You don't say what version of Outlook you're working with (always do that),
but the Outlook 2007 object model has a NameSpace method
GetSelectNamesDialog() that is the To, etc. dialog. That can be customized
and set up as you like, but to know when To was clicked you'd still need
what I said in the first paragraph of my answer. There's nothing equivalent
in the earlier Outlook object models. although CDO 1.21 does provide a
Session.AddressBook() function that's roughly equivalent to the Outlook 2007
GetSelectNamesDialog() method.

Please do not multipost.

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


"Zengfu Xu" wrote in message
news
Hi,

I want to override the 'To' button click event in Outlook so that user can
select
a right contact from the list of contact in the organisation other than
the
contacts stored in Outlook. Can any one tell me if we can override the
'To'
button click event
using VB so that it would do what we want? If so then how?

Many thnaks!

Zengfu Xu
--
Software Developer
Office Automation


  #3  
Old May 20th 09, 04:36 AM posted to microsoft.public.outlook.program_vba
Zengfu Xu
external usenet poster
 
Posts: 3
Default Override the 'To' Button in Outlook

Hi Ken,

Thank you very much for your help.

I can use WM_CLOSE message to close the To dialog screen. But how can I use
the Win32 API calls and callbacks to handle the 'To' dialog window ("Select
Names") opening?

Our clients use both Outlook 2003 and Outlook 2007. We do like to provide our
own dialog screen for the contact list otherthan Outlook's address book.

Many thanks

Zengfu Xu
--
Software Developer
Office Automation


"Ken Slovak - [MVP - Outlook]" wrote:

No. That dialog opening event isn't exposed anywhere. You'd have to use
Win32 API calls and callbacks to handle the dialog window opening and send
it a WM_CLOSE message, then you'd have to provide your own dialog in its
place.

You could handle the PropertyChange() event on the item to trap when a
selection is made from the To dialog, but that would be after the fact.

You don't say what version of Outlook you're working with (always do that),
but the Outlook 2007 object model has a NameSpace method
GetSelectNamesDialog() that is the To, etc. dialog. That can be customized
and set up as you like, but to know when To was clicked you'd still need
what I said in the first paragraph of my answer. There's nothing equivalent
in the earlier Outlook object models. although CDO 1.21 does provide a
Session.AddressBook() function that's roughly equivalent to the Outlook 2007
GetSelectNamesDialog() method.

Please do not multipost.

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


"Zengfu Xu" wrote in message
news
Hi,

I want to override the 'To' button click event in Outlook so that user can
select
a right contact from the list of contact in the organisation other than
the
contacts stored in Outlook. Can any one tell me if we can override the
'To'
button click event
using VB so that it would do what we want? If so then how?

Many thnaks!

Zengfu Xu
--
Software Developer
Office Automation



  #4  
Old May 20th 09, 03:29 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Override the 'To' Button in Outlook

Once you know the window hWnd for that dialog you can close it, to respond
to it opening would require handling all Windows messages looking for
creation of that window (the select names dialog). You'd close that and open
your own dialog. Whether that dialog was an ATL form template or a Windows
Form or whatever in whatever language you're using. Since you'd be creating
that dialog from scratch you would be able to handle its appearance and its
return value.

It's not going to be easy or simple, and you'll have to work out most of the
details yourself.

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


"Zengfu Xu" wrote in message
...
Hi Ken,

Thank you very much for your help.

I can use WM_CLOSE message to close the To dialog screen. But how can I
use
the Win32 API calls and callbacks to handle the 'To' dialog window
("Select
Names") opening?

Our clients use both Outlook 2003 and Outlook 2007. We do like to provide
our
own dialog screen for the contact list otherthan Outlook's address book.

Many thanks

Zengfu Xu
--
Software Developer
Office Automation


 




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
adding button like encryption and signing information button Ramazan Add-ins for Outlook 2 October 7th 08 02:57 PM
Outlook send button nabsnabs Outlook - Using Contacts 1 August 21st 08 05:51 PM
Outlook Office Button ronnieg56 Outlook - General Queries 3 October 7th 07 03:11 AM
Button location in button bar Leah Ann Add-ins for Outlook 1 August 11th 06 03:16 PM
Outlook Button adubb Outlook - Using Forms 0 April 13th 06 08:31 PM


All times are GMT +1. The time now is 08:11 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.