Results 1 to 2 of 2

Thread: C# and Outlook Calendar **SOLVED**

  1. #1

    Thread Starter
    Hyperactive Member Sgt-Peppa's Avatar
    Join Date
    Mar 2003
    Location
    Munich - Germany
    Posts
    476

    C# and Outlook Calendar **SOLVED**

    Hey all,

    I am trying to get all my appointments stored in my Outlook Calendar. Problem is that it seems like I cant go through my appointments using the next method. Heres my code:

    Code:
    myApp = new Outlook.Application(); 
    myNamespace= myApp.GetNamespace("MAPI"); 
    myNamespace.Logon(null,null,false,true);
    
    string test = "";
    		myFolder = myNamespace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar);
    		Outlook._AppointmentItem myItem;
    		myItem =(Outlook._AppointmentItem)myFolder.Items.GetFirst();
    		test = myFolder.Items.Count.ToString();
    		for (int x =0;x < myFolder.Items.Count;x++)
    		{
    			test = test + myItem.Subject.ToString();
    			myItem =(Outlook._AppointmentItem)myFolder.Items.GetNext();
    		}
    All it does is get the firts entry using
    Code:
     
    		myItem =(Outlook._AppointmentItem)myFolder.Items.GetFirst();
    and the next one using
    Code:
    			myItem =(Outlook._AppointmentItem)myFolder.Items.GetNext();
    So I get 92 times one Entry and the first one.

    Hope this explanation is not to confusing

    Thanks,

    Stephan
    Last edited by Sgt-Peppa; Apr 26th, 2004 at 04:00 AM.
    Keep Smiling - even if its hard
    Frankie Says Relax, wossname Says Yeah!
    wossname:--Currently I'm wearing a gimp suit and a parachute.
    C# - Base64 Blog

  2. #2

    Thread Starter
    Hyperactive Member Sgt-Peppa's Avatar
    Join Date
    Mar 2003
    Location
    Munich - Germany
    Posts
    476
    Ok found a workaround will post it tomorrow when I'm back home!

    Thanks,

    Stephan
    Keep Smiling - even if its hard
    Frankie Says Relax, wossname Says Yeah!
    wossname:--Currently I'm wearing a gimp suit and a parachute.
    C# - Base64 Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width