Typecasting the Item object

  • Thread starter Thread starter Composer
  • Start date Start date
C

Composer

I have a slightly modified Appointment form, with a button. The VBS
code behind the button passes the intrinsic Item object to a VBA
subroutine that's within ThisOutlookSession.

My problem is in using the Item object as an Outlook.AppointmentItem.
Within VBA, I find that:

currentItem.Class = olAppointment

TypeName(currentItem) = "AppointmentItem"

but...

(TypeOf currentItem Is Outlook.AppointmentItem)
... is False!

and...

Dim appt As Outlook.AppointmentItem
Set appt = currentItem
... causes Type Mismatch

Can someone please tell me what I'm doing wrong? Thanks.
 
I've worked around the problem as follows:

Don't pass any parameter from VBS to VBA.

VBS calls a VBA routine which uses
Application.ActiveInspector.currentItem to find the currently displayed
AppointmentItem.
 
Back
Top