[AccessD] A2003: Runtime Error Type Mismatch

Erwin Craps - IT Helps Erwin.Craps at ithelps.be
Fri Mar 11 02:51:01 CST 2005


I kown that one...
Had same prob with E-mails...

Not all items in your calender are necesary appointment items.
Your code fails on one item in your calender that could be an another
Outlook or customized type item.

I had this with E-mails, the virus warnings but als incoming faxes where
not an e-mail item.

You should declare this way
Dim myAppt As object
   
But you will need to check each item to see if it is an appointment or
not in your loop and do the appropriate thing with it.

Erwin



 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren DICK
Sent: Friday, March 11, 2005 3:55 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] A2003: Runtime Error Type Mismatch

(Cross Posted to Dmitry and Sue's List)

Hello all
I have the code below working fine until today It errors on the last
line in this code The error is Runtime Error 13 Type Mismatch

Can anyone explain why it used to work - now it doesn't?
References are good - Though once this rubbish started I manually
removed them and re attached them - no luck OFFICE 11

May thanks in Advance

Darren

'+++++++++++++++++++<SNIP>
   Dim ol As Outlook.Application
   Dim olns As Outlook.NameSpace
   Dim objFolder As Outlook.MAPIFolder
   Dim AllAppts As Outlook.Items
   Dim myAppt As Outlook.AppointmentItem
        
    Set ol = New Outlook.Application
    Set olns = ol.GetNamespace("MAPI")

    Set objFolder = olns.GetDefaultFolder(olFolderCalendar)
    Set AllAppts = objFolder.Items
        
    Dim appSQL As String
    Dim strOutLookID  As String
        
    For Each myAppt In AllAppts '<======ERROR IS HERE

'++++++++++</Snip>

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list