none
Update Outlook 2003 Appointment RRS feed

  • Question

  • Hi, i get from Outlook 2003 via Mapi and VB.Net open appointments that not yet responded.


    objOL = New Outlook.Application
            objNS = objOL.GetNamespace("MAPI")
            fldKalender = objNS.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderCalendar)
            Dim oItems1 As Outlook.Items

            Dim sCriteria As String
            sCriteria = "[ResponseStatus] = " & Convert.ToInt32(Outlook.OlResponseStatus.olResponseNotResponded).ToString
            oItems1 = fldKalender.Items
            oItems1.Sort("[Start]", True)
            oItems1 = oItems1.Restrict(sCriteria)

     

    Now i want commit the appointment (exactly the same as directly in outlook). i think i must change the responsestatus. but this property is read only. how can i through vb.net commit the appointment?

     

     

    Friday, June 17, 2011 1:10 PM

Answers

  • Not offhand, and any code would vary depending on what response you wanted to send. But here's some code from the Outlook VBA project Object Browser Help that shows how to respond with an acceptance:
     
    Sub AcceptMeeting()
      Dim myNameSpace As Outlook.NameSpace
      Dim myFolder As Outlook.Folder
      Dim myMtgReq As Outlook.MeetingItem
      Dim myAppt As Outlook.AppointmentItem
      Dim myMtg As Outlook.MeetingItem
     
      Set myNameSpace = Application.GetNamespace("MAPI")
      Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)
      Set myMtgReq = myFolder.Items.Find("[MessageClass] = 'IPM.Schedule.Meeting.Request'")
      If TypeName(myMtgReq) <> "Nothing" Then
        Set myAppt = myMtgReq.GetAssociatedAppointment(True)
        Set myMtg = myAppt.Respond(olResponseAccepted, True)
        myMtg.Send
      End If
    End Sub

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Thomas Klinger2" <=?utf-8?B?VGhvbWFzIEtsaW5nZXIy?=> wrote in message news:ece3afbf-0f68-4a51-823d-f14bfb28a0d6...
    hi ken, did you have a sample for that ?

    Ken Slovak MVP - Outlook
    Monday, June 20, 2011 2:08 PM

All replies

  • You would have to call the Respond() method for the appointment to change the ResponseStatus property.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Thomas Klinger2" <=?utf-8?B?VGhvbWFzIEtsaW5nZXIy?=> wrote in message news:616f0d8c-83a7-4239-b8f0-78cc1531c66a...

    Hi, i get from Outlook 2003 via Mapi and VB.Net open appointments that not yet responded.


    objOL = New Outlook.Application
            objNS = objOL.GetNamespace("MAPI")
            fldKalender = objNS.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderCalendar)
            Dim oItems1 As Outlook.Items

            Dim sCriteria As String
            sCriteria = "[ResponseStatus] = " & Convert.ToInt32(Outlook.OlResponseStatus.olResponseNotResponded).ToString
            oItems1 = fldKalender.Items
            oItems1.Sort("[Start]", True)
            oItems1 = oItems1.Restrict(sCriteria)

     

    Now i want commit the appointment (exactly the same as directly in outlook). i think i must change the responsestatus. but this property is read only. how can i through vb.net commit the appointment?

     

     


    Ken Slovak MVP - Outlook
    Friday, June 17, 2011 1:34 PM
  • hi ken, did you have a sample for that ?
    Sunday, June 19, 2011 5:35 PM
  • Not offhand, and any code would vary depending on what response you wanted to send. But here's some code from the Outlook VBA project Object Browser Help that shows how to respond with an acceptance:
     
    Sub AcceptMeeting()
      Dim myNameSpace As Outlook.NameSpace
      Dim myFolder As Outlook.Folder
      Dim myMtgReq As Outlook.MeetingItem
      Dim myAppt As Outlook.AppointmentItem
      Dim myMtg As Outlook.MeetingItem
     
      Set myNameSpace = Application.GetNamespace("MAPI")
      Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)
      Set myMtgReq = myFolder.Items.Find("[MessageClass] = 'IPM.Schedule.Meeting.Request'")
      If TypeName(myMtgReq) <> "Nothing" Then
        Set myAppt = myMtgReq.GetAssociatedAppointment(True)
        Set myMtg = myAppt.Respond(olResponseAccepted, True)
        myMtg.Send
      End If
    End Sub

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Thomas Klinger2" <=?utf-8?B?VGhvbWFzIEtsaW5nZXIy?=> wrote in message news:ece3afbf-0f68-4a51-823d-f14bfb28a0d6...
    hi ken, did you have a sample for that ?

    Ken Slovak MVP - Outlook
    Monday, June 20, 2011 2:08 PM