Typecasting the Item object

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.
 
C

Composer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top