Override the 'To' Button in Outlook

Status
Not open for further replies.
W

WmVuZ2Z1IFh1

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
 
K

Ken Slovak - [MVP - 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.

"Zengfu Xu" <zengfu.xu@automation.com.au> wrote in message

news:D7B9D793-6EB4-45BB-84C0-5D0D979F121A@microsoft.com...
> 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
 
W

WmVuZ2Z1IFh1

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

> >

>

> "Zengfu Xu" <zengfu.xu@automation.com.au> wrote in message
> news:D7B9D793-6EB4-45BB-84C0-5D0D979F121A@microsoft.com...
> > 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


>
 
K

Ken Slovak - [MVP - 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.

"Zengfu Xu" <zengfu.xu@automation.com.au> wrote in message

news:1C6A1642-ACCC-48C6-961E-B758843D8D06@microsoft.com...
> 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
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
L How to automaticlly Send/Receive every 3 mins but override send if send/receive is pressed Using Outlook 2
N Does a Shared Folder Policy override a Digital Signature Setting for macros? Outlook VBA and Custom Forms 6
L Need to Override Outlook 2007's security Outlook VBA and Custom Forms 1
D Outlook 2013 Macros only run in VB editor, not in drop down or button Outlook VBA and Custom Forms 10
N contact list seen in Contact folder but knot in Address book or when 'TO' button is clicked in new email Using Outlook 0
witzker HowTo start a macro with an Button in OL contact form Outlook VBA and Custom Forms 12
R Follow up button doesn't working neither the reminders in BCM BCM (Business Contact Manager) 0
Eike Move mails via macro triggered by the click of a button? Outlook VBA and Custom Forms 0
K Disabling import/export button to restrict PST creation Using Outlook 3
N Which Button Was Clicked on the Ribbonbar Menu Outlook VBA and Custom Forms 2
E Can't accept or decline task (no button appears) Using Outlook 2
M VbScript for Command Button on Contacts Custom Form Using Outlook 1
Q Prompt button to auto turn on Out of Office Outlook VBA and Custom Forms 3
C iCloud Setting missing Outlook tab and Outlook missing the iCloud refresh button Using Outlook 4
witzker Outlook 2010 Insert Date & Time at the button of an OL contactform in red Using Outlook 2
S How to set up button in ribbon for individual Quick Steps Using Outlook 1
C Custom Outlook Form - Populate Information from Radio Button / Check Box Using Outlook 0
J Command Button to stamp a date and time in a textbox in Outlook 2016 Outlook VBA and Custom Forms 3
A ScanPST finding errors but no Repair button Using Outlook 2
N Creating a button or link to a form in the Organizational Forms Library Outlook VBA and Custom Forms 3
J Execute Add-In Button from VBA Outlook 2016 Outlook VBA and Custom Forms 1
D Command Button code will not execute. Any suggestions Please. Outlook VBA and Custom Forms 2
S Reminder Dialog Open Button Using Outlook 2
Wayne Dardis Calling Ribbon Button in Outlook 2016 Outlook VBA and Custom Forms 6
Tanja Östrand Outlook 2016 - Create Macro button to add text in Subject Outlook VBA and Custom Forms 1
R Categorize Button in Quick Access Toolbar Disappears on New Email Using Outlook 1
S Problem running Command button code Outlook VBA and Custom Forms 2
E Button to change subject Outlook VBA and Custom Forms 1
S Shortcut/button to a Calendar Group Using Outlook 0
soadfan Enable all rules from toolbar button? Outlook VBA and Custom Forms 3
I Creating meeting invite with disabled tentative button Outlook VBA and Custom Forms 5
Diane Poremsky Contacts are missing when you click the To button New Slipstick.com Articles 0
T Unable to 'Upload a file' using popup 'Browse' button Using Outlook 0
makinmyway ScanPST.exe Missing Repair Button Using Outlook 15
williamlambton Reinstate "Open" button on mail item right-click context menu. Outlook Wishlist 2
K Remove Manage APPS button for users Exchange Server Administration 1
J Send and Receive Button - only check default account? Using Outlook 1
A custom send button Outlook VBA and Custom Forms 3
P Possibility to create a calendar button "remaining week"??? Using Outlook 3
E Outlook 2007: Problem with "Move to Folder >" button on toolbar Using Outlook 6
E Button in body of email to approve/reject with original text Using Outlook 1
H Preventing the Send button from being clicked on an Outlook Form Outlook VBA and Custom Forms 1
S Create a custom "Send" Button Outlook VBA and Custom Forms 3
makinmyway Can I add a Map It Button to Custom Contact Form? How? Outlook VBA and Custom Forms 6
R How can I retain embedded object with voting button reply? Using Outlook 5
G Moving "Delete" button on Outlook for Mac Using Outlook 1
K OL2010 Button to Insert First Name Outlook VBA and Custom Forms 6
K OL2010 Button to Insert First Name Using Outlook 1
R Outlook 2013 People Pane - Where is the "Add" button for social networks? Using Outlook 4
C Button to Forward and Move Using Outlook 4

Similar threads

Top