none
Populating a New Appointment with Text and Time information RRS feed

  • Question

  • Hello,

    I am creating an Outlook Add-in with Visual Studio 2012 and Outlook 2010, using c#. I would like a user to right-click on an open space in the calendar and select a menu option labeled "Conference Call" to create a new appointment with the body pre-populated with our call service information.

    I've figure out how to add the context sensitive menu item and fill out the subject and body of the new appointment. I don't know how to pass the selected day and time to the new appointment. 

    Does anyone have any suggestions?

    Many thanks,

    Rex

    Tuesday, June 11, 2013 6:40 PM

Answers

All replies

  • Hi Rex,

    Thank you for posting in the MSDN Forum.

    You might want to use

    Hope it helps.

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, June 13, 2013 9:37 AM
    Moderator
  • If you get the ActiveExplorer().CurrentView as a View object and cast it to a CalendarView object you can use the CalendarView.SelectedStartTime and SelectedEndTime properties, those properties might help with what you want.

    Ken Slovak MVP - Outlook

    Thursday, June 13, 2013 2:04 PM
  • Ken,

    This sounds like a good approach and I appreciate the response. I don't suppose I could get you to explain the process in a code snippet? I'm pretty new to the Outlook object model and I don't know my way around.

    Many thanks.

    Wednesday, June 19, 2013 2:26 PM
  • Where oOL is an Outlook.Application object in your code:

    Outlook.Explorer expl = oOL.ActiveExplorer();

    Outlook.View vw = expl.CurrentView;

    Outlook.CalendarView calView = vw as Outlook.CalendarView;

    if (calView != null)

    {

    DateTime startTime = calView.SelectedStartTime;

    // and so on


    Ken Slovak MVP - Outlook

    Wednesday, June 19, 2013 3:11 PM