How to read the selected appointments from ms outlook into our application

Last post 07-06-2009 5:00 AM by tapanrami@hotmail.com. 2 replies.

Sort Posts:

  • How to read the selected appointments from ms outlook into our application

    04-02-2009, 11:32 PM
    • Member
      51 point Member
    • cutekids525
    • Member since 05-02-2008, 11:38 AM
    • India
    • Posts 172

    Hi all,

    Is there any way to read the selected appointments from ms outlook into our .net application.

    Please help me.

    Thanks,
    Cute
  • Re: How to read the selected appointments from ms outlook into our application

    07-06-2009, 3:42 AM
    • Participant
      846 point Participant
    • Revdoniv
    • Member since 06-29-2009, 6:58 AM
    • Posts 168

    Microsoft.Office.Interop.Outlook.Application outlook = new Application();
                Microsoft.Office.Interop.Outlook.NameSpace oNS = outlook.GetNamespace("MAPI");

                oNS.Logon("Profile Name", "Your Password", true, false);

                Microsoft.Office.Interop.Outlook.MAPIFolder objMAPIFolder = oNS.GetDefaultFolder(OlDefaultFolders.olFolderCalendar);
                Items items = objMAPIFolder.Items;
                foreach (object item in items)
                {
                    if (item is Microsoft.Office.Interop.Outlook.AppointmentItem)
                    {
                        Microsoft.Office.Interop.Outlook.AppointmentItem mitem = item as Microsoft.Office.Interop.Outlook.AppointmentItem;
                        string subject = mitem.Subject;
                        Console.WriteLine(subject);
                    }


                }
                oNS.Logoff();
                outlook.Quit();
                Console.ReadLine();
                
            }


    Have a great Day!

    Regards

    Revdoniv

    Please mark this as "Answer" if it helps you
  • Re: How to read the selected appointments from ms outlook into our application

    07-06-2009, 5:00 AM
    Please mark as answer if you find this useful.

    Thanking You
    Tapan
Page 1 of 1 (3 items)