Thread: Missing updates
View Single Post
  #9  
Old December 27th 06, 03:44 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Missing updates

Of course you can trap an error in code. Just use an error handler or set On
Error Resume Next and test the Err object after every operation that might
throw an error. If in doubt clear the Err object before performing the
operation so you know it's clear before you start.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"boh" wrote in message
...
"Hi
I have comment out the statement "On Error Resume Next" and added a
statement If Item.Class = olAppointment Then" do the stuff . It works fine
the first time and Debug.Print "ItemChange Item = " & Item - "ItemChange
Item = Test" but when the macro runs for the 2'nd time I get an run-time
error '-2147221233 (800401f)':Automation error. I think I have to do a
better
check of the Item object before I use it but how? I think the appointment
that fires the event is moved to the public folder during the 1'st run of
the
macro and thats why I get problems. Is it possible to trap a error with
code?
If yes, how do I do?
Thanks / boh


Ads