It has formed a VBA would get an error in the "Outlook2010".
I am a beginner. "Run-time error '91': Object variable or With block variable not set." An error in the mark of the place. What I have tried: <pre lang="VB.NET">Public Sub DisplaySubjectByRule(ByRef objItem As MeetingItem) 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'") Set myMtgReq2 = myFolder.Items.Find("[MessageClass] = 'IPM.Schedule.Meeting.Canceled'") If TypeName(myMtgReq) <> "Nothing" Then Set myAppt = myMtgReq.GetAssociatedAppointment(True) Set myMtg = myAppt.Respond(olResponseAccepted, True) myMtg.Send 'Error! ElseIf TypeName(myMtgReq2) = "Nothing" Then Set myAppt = myMtgReq2.GetAssociatedAppointment(False) Set myMtg = myAppt.Respond(olResponseAccepted, False) myMtg.Send 'Error! myMtg.Delete End If End Sub</pre>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)