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 » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

SelectionChange Event in Outlook Calender



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 27th 06, 12:10 PM posted to microsoft.public.outlook.program_addins
lg
external usenet poster
 
Posts: 26
Default SelectionChange Event in Outlook Calender

Hi,
I am writing a Addin for Outlook in C#. In the calender in Outlook, I am
looking to retrieve the date a user clicks on (i.e. if the user selects any
date on the calender weather it has an appointment or not). I am able to
catch the event for when the user selects a date by using the SelectionChange
event but I am not able to know what date was selected ? Is it possible to
find the date selected and if so how ? Thanks.
Ads
  #2  
Old September 27th 06, 01:01 PM posted to microsoft.public.outlook.program_addins
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default SelectionChange Event in Outlook Calender

Outlook fires no event when the user selects a date/time range. You can, however, use CommandBars methods to execute the New button from the toolbar/menu. That will create a new appointment using the user's selected date/time range. You can get the dates from that appointment and then discard it.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"lg" wrote in message ...
Hi,
I am writing a Addin for Outlook in C#. In the calender in Outlook, I am
looking to retrieve the date a user clicks on (i.e. if the user selects any
date on the calender weather it has an appointment or not). I am able to
catch the event for when the user selects a date by using the SelectionChange
event but I am not able to know what date was selected ? Is it possible to
find the date selected and if so how ? Thanks.

  #3  
Old September 27th 06, 02:56 PM posted to microsoft.public.outlook.program_addins
lg
external usenet poster
 
Posts: 26
Default SelectionChange Event in Outlook Calender

When you click on a date on the calender (the yellow cells), the
"SelectChange" event seems to get fired (it also gets fired when you select
between different mail items in your mail box and possiblely or items in
different folders aswell). I will try opening a new appointment item, reading
the date and discarding it again but will this not cause an appointment item
to flash up on the screen each time the user clicks on a differnet date in
the calender ?

"Sue Mosher [MVP-Outlook]" wrote:

Outlook fires no event when the user selects a date/time range. You can, however, use CommandBars methods to execute the New button from the toolbar/menu. That will create a new appointment using the user's selected date/time range. You can get the dates from that appointment and then discard it.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"lg" wrote in message ...
Hi,
I am writing a Addin for Outlook in C#. In the calender in Outlook, I am
looking to retrieve the date a user clicks on (i.e. if the user selects any
date on the calender weather it has an appointment or not). I am able to
catch the event for when the user selects a date by using the SelectionChange
event but I am not able to know what date was selected ? Is it possible to
find the date selected and if so how ? Thanks.


  #4  
Old September 27th 06, 03:10 PM posted to microsoft.public.outlook.program_addins
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default SelectionChange Event in Outlook Calender

Yes, but you can close it as soon as you get the dates from it. Unless the user has a really slow system, they shouldn't notice.

"lg" wrote in message ...
When you click on a date on the calender (the yellow cells), the
"SelectChange" event seems to get fired (it also gets fired when you select
between different mail items in your mail box and possiblely or items in
different folders aswell). I will try opening a new appointment item, reading
the date and discarding it again but will this not cause an appointment item
to flash up on the screen each time the user clicks on a differnet date in
the calender ?

"Sue Mosher [MVP-Outlook]" wrote:

Outlook fires no event when the user selects a date/time range. You can, however, use CommandBars methods to execute the New button from the toolbar/menu. That will create a new appointment using the user's selected date/time range. You can get the dates from that appointment and then discard it.

"lg" wrote in message ...
Hi,
I am writing a Addin for Outlook in C#. In the calender in Outlook, I am
looking to retrieve the date a user clicks on (i.e. if the user selects any
date on the calender weather it has an appointment or not). I am able to
catch the event for when the user selects a date by using the SelectionChange
event but I am not able to know what date was selected ? Is it possible to
find the date selected and if so how ? Thanks.


  #5  
Old October 3rd 06, 11:44 AM posted to microsoft.public.outlook.program_addins
lg
external usenet poster
 
Posts: 26
Default SelectionChange Event in Outlook Calender

Hi Sue,
Thanks for the help, I have managed to access the new button to open a
new appointment item but it keeps accessing the drop-down part of the button
that shows the other options in the new button and dosnt create a new
appointment item.

Office.CommandBar cb =
(Office.CommandBar)m_hExplorerObj.CommandBars["Standard"];

Office.CommandBarControl cbc = (Office.CommandBarControl)cb.Controls["&New"];

cbc.Execute();

How do I get it to create a new appointment item and does it return a handle
to that appointment so I can close it again ?
"Sue Mosher [MVP-Outlook]" wrote:

Yes, but you can close it as soon as you get the dates from it. Unless the user has a really slow system, they shouldn't notice.

"lg" wrote in message ...
When you click on a date on the calender (the yellow cells), the
"SelectChange" event seems to get fired (it also gets fired when you select
between different mail items in your mail box and possiblely or items in
different folders aswell). I will try opening a new appointment item, reading
the date and discarding it again but will this not cause an appointment item
to flash up on the screen each time the user clicks on a differnet date in
the calender ?

"Sue Mosher [MVP-Outlook]" wrote:

Outlook fires no event when the user selects a date/time range. You can, however, use CommandBars methods to execute the New button from the toolbar/menu. That will create a new appointment using the user's selected date/time range. You can get the dates from that appointment and then discard it.

"lg" wrote in message ...
Hi,
I am writing a Addin for Outlook in C#. In the calender in Outlook, I am
looking to retrieve the date a user clicks on (i.e. if the user selects any
date on the calender weather it has an appointment or not). I am able to
catch the event for when the user selects a date by using the SelectionChange
event but I am not able to know what date was selected ? Is it possible to
find the date selected and if so how ? Thanks.


  #6  
Old October 4th 06, 01:12 AM posted to microsoft.public.outlook.program_addins
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default SelectionChange Event in Outlook Calender

Don't use The name of the control. Use the ID, together with the FindControl method. The ID for a new appointment is 1106. See http://www.outlookcode.com/codedetail.aspx?id=616 for a VBA code sample.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"lg" wrote in message ...
Hi Sue,
Thanks for the help, I have managed to access the new button to open a
new appointment item but it keeps accessing the drop-down part of the button
that shows the other options in the new button and dosnt create a new
appointment item.

Office.CommandBar cb =
(Office.CommandBar)m_hExplorerObj.CommandBars["Standard"];

Office.CommandBarControl cbc = (Office.CommandBarControl)cb.Controls["&New"];

cbc.Execute();

How do I get it to create a new appointment item and does it return a handle
to that appointment so I can close it again ?
"Sue Mosher [MVP-Outlook]" wrote:

Yes, but you can close it as soon as you get the dates from it. Unless the user has a really slow system, they shouldn't notice.

"lg" wrote in message ...
When you click on a date on the calender (the yellow cells), the
"SelectChange" event seems to get fired (it also gets fired when you select
between different mail items in your mail box and possiblely or items in
different folders aswell). I will try opening a new appointment item, reading
the date and discarding it again but will this not cause an appointment item
to flash up on the screen each time the user clicks on a differnet date in
the calender ?

"Sue Mosher [MVP-Outlook]" wrote:

Outlook fires no event when the user selects a date/time range. You can, however, use CommandBars methods to execute the New button from the toolbar/menu. That will create a new appointment using the user's selected date/time range. You can get the dates from that appointment and then discard it.

"lg" wrote in message ...
Hi,
I am writing a Addin for Outlook in C#. In the calender in Outlook, I am
looking to retrieve the date a user clicks on (i.e. if the user selects any
date on the calender weather it has an appointment or not). I am able to
catch the event for when the user selects a date by using the SelectionChange
event but I am not able to know what date was selected ? Is it possible to
find the date selected and if so how ? Thanks.


  #7  
Old October 4th 06, 03:09 PM posted to microsoft.public.outlook.program_addins
lg
external usenet poster
 
Posts: 26
Default SelectionChange Event in Outlook Calender

Thats works perfectly, thanks Sue. The only thing though, the new appointment
ID 1106 did'nt work so I had to use ID 1992

"Sue Mosher [MVP-Outlook]" wrote:

Don't use The name of the control. Use the ID, together with the FindControl method. The ID for a new appointment is 1106. See http://www.outlookcode.com/codedetail.aspx?id=616 for a VBA code sample.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"lg" wrote in message ...
Hi Sue,
Thanks for the help, I have managed to access the new button to open a
new appointment item but it keeps accessing the drop-down part of the button
that shows the other options in the new button and dosnt create a new
appointment item.

Office.CommandBar cb =
(Office.CommandBar)m_hExplorerObj.CommandBars["Standard"];

Office.CommandBarControl cbc = (Office.CommandBarControl)cb.Controls["&New"];

cbc.Execute();

How do I get it to create a new appointment item and does it return a handle
to that appointment so I can close it again ?
"Sue Mosher [MVP-Outlook]" wrote:

Yes, but you can close it as soon as you get the dates from it. Unless the user has a really slow system, they shouldn't notice.

"lg" wrote in message ...
When you click on a date on the calender (the yellow cells), the
"SelectChange" event seems to get fired (it also gets fired when you select
between different mail items in your mail box and possiblely or items in
different folders aswell). I will try opening a new appointment item, reading
the date and discarding it again but will this not cause an appointment item
to flash up on the screen each time the user clicks on a differnet date in
the calender ?

"Sue Mosher [MVP-Outlook]" wrote:

Outlook fires no event when the user selects a date/time range. You can, however, use CommandBars methods to execute the New button from the toolbar/menu. That will create a new appointment using the user's selected date/time range. You can get the dates from that appointment and then discard it.

"lg" wrote in message ...
Hi,
I am writing a Addin for Outlook in C#. In the calender in Outlook, I am
looking to retrieve the date a user clicks on (i.e. if the user selects any
date on the calender weather it has an appointment or not). I am able to
catch the event for when the user selects a date by using the SelectionChange
event but I am not able to know what date was selected ? Is it possible to
find the date selected and if so how ? Thanks.



 




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
print the details of each event in Outlook calender Pat K Outlook - Calandaring 1 September 2nd 06 04:16 PM
Outlook should have an out off office flag link to calender event Mathieu Outlook - Calandaring 2 July 25th 06 11:11 PM
how do I add 3 time stamps for an event in calender shaunt Outlook - Calandaring 1 May 10th 06 02:22 PM
Macro to create repeating calender event/meeting Graham Outlook and VBA 4 March 18th 06 06:49 PM
SelectionChange Event A. Blundon Outlook and VBA 2 February 27th 06 07:52 PM


All times are GMT +1. The time now is 09:22 AM.


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.