"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
"Ken Slovak - [MVP - Outlook]" skrev:
The Item.Copy function will always copy the item to the source folder of the
item. You can set up a flag that's set when you copy the item so you ignore
the next change event.
If you're using a lower level API such as CDO 1.21 or Redemption you can use
Message.CopyTo (CDO) or Safe*Item.CopyTo or RDOMail.CopyTo (both from
Redemption) to avoid the copy to the source folder.
--
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 Ken
I did as you said. When all my macro is comment out, I get debug prints as
wanted. I can see I’m doing some mistake when moving an item around. I
want
to copy the item which is argument to ItemChange to the public folder,
then
change some objects and save the appointment in the public folder but I
can’t
figure out how to do. My copy stores in my local folder which means I get
another ItemAdd event. Please HELP.
boh