![]() |
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 |