Custom AppointmentItem code does not run in MeetingRequestItem (321690)



The information in this article applies to:

  • Microsoft Office Outlook 2003, Service Pack 1 (SP1)
  • Microsoft Office Outlook 2003
  • Microsoft Outlook 2002
  • Microsoft Outlook 2000

This article was previously published under Q321690

SYMPTOMS

Microsoft Visual Basic Scripting Edition (VBScript) code in a custom AppointmentItem or TaskItem object does not run when the MeetingRequestItem or the TaskRequestItem object arrives in the recipient's Inbox. The MeetingRequestItem and the TaskRequestItem appear to be customized, but the code does not run.

CAUSE

When a customized appointment arrives in the Inbox, the message class changes from the custom message class of IPM.Appointment.myAppointmentForm to IPM.Schedule.Meeting.Request (where myAppointmentForm is the user-defined, published form name). Similarly, when a customized task request arrives in the Inbox, the message class changes from the custom message class of IPM.Task.myTaskForm to IPM.TaskRequest (where myTaskForm is the user-defined, published form name).

The AppointmentItem and the TaskItem data is bundled and is hidden in MeetingRequestItem and in TaskRequestItem such that the code does not exist directly in the MeetingRequestItem or the TaskRequestItem object. Although the form appears to be customized, the code does not run. The VBScript code cannot run because AppointmentItem and TaskItem are packaged. This behavior is a result of the design of MeetingRequest objects and TaskRequest objects.

WORKAROUND

You can create a custom Message form solution that simulates a MeetingRequestItem or a TaskRequestItem. Create a custom Message form that contains modifications that, when they are received, simulate a MeetingRequestItem or TaskRequestItem.

Alternatively, you can use the FormSwap utility to replace a standard form with a custom form that is based on the message class. For example, you can replace the IPM.Schedule.Meeting.Request form with IPM.Appointment.myAppointmentForm (where myAppointmentForm is the user-defined, published form name). The FormSwap utility is available from the Microsoft Office Resource Kit. To obtain the FormSwap utility, visit the following Microsoft Web site, and then click Download Now next to Formsadmin.exe:

STATUS

This behavior is by design.

MORE INFORMATION

Steps to reproduce the behavior

  1. Open a new Appointment form in Design mode.
  2. Hide the standard Appointment page. To do this, click to clear the Display This Page check box on the Tools menu.
  3. On the P.2 page, use the Field Chooser to add the Required Attendees, the Subject, and the Start fields.
  4. Add the following code in the Script code window:
    Function Item_Open()
         msgbox "Open event fired"
    End Function
      
    Sub Item_PropertyChange(ByVal Name)
         select case Name
              case "Subject"
      	       msgbox "PropertyChange event fired"
         end Select
    End Sub
    					
  5. Publish the form.
  6. Open the form from the published location. Notice that the Open event fires.
  7. Type the subject. Notice that the PropertyChange event fires.
  8. Click Invite Attendees on the form.
  9. Type an e-mail address in the Required Attendees box, type a start time in the Start box, and then click Send.
  10. Open the meeting request from the recipient's Inbox. Notice that the Open event does not fire.
  11. Change the text in the Subject box, and then press the TAB key to move out of the text box. Notice that the PropertyChange event does not fire.
  12. Accept the meeting request, and then open the appointment from the Calendar. Notice that the Open event fires.
  13. Change the text in the Subject box. Notice that the PropertyChange event fires.

REFERENCES

For more information about available resources and answers to frequently asked questions about Microsoft Outlook solutions, click the following article numbers to view the articles in the Microsoft Knowledge Base:

287530 Frequently asked questions about custom forms and Outlook solutions

146636 Frequently asked questions about custom forms and Outlook solutions


Modification Type:MinorLast Reviewed:4/3/2006
Keywords:kbprb KB321690