ItemChange event

Status
Not open for further replies.

jepp

Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
Hi.
I have a problem with events NewInspector and ItemChange.
In first event a copy, of contact being opened, is created. This copy is then moved to backup folder.
The second event is triggered right after the first one, probably because of a copy created in first event.
But, if I run first event step by step, then the second event ItemChange is not triggered.

I don't understand what is triggering the ItemChange after NewInspector event. Is it a copy of the contact?
And why the ItemChange is not triggered if i ran the code step by step?

Thanks. George
 

jepp

Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
I also figure it out, that ItemChange goes to endless loop. Is it posible because of item.copy - item.move?
 

jepp

Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
Can you post the code you are using? Are you moving the copy or the original item? If you move the original, you are changing it.

Set the copy to a new item then move the copy.
Hi Diane. I am moving the copy of the original item. I figure it out, that event is triggered because of moving the copy to the destination folder. That folder is not monitored for changes. But ItemChange fires anyway and it cannot find copied item. When setting object, error "An object could not be found" comes up.
 

jepp

Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
Can you post the code you are using? Are you moving the copy or the original item? If you move the original, you are changing it.

Set the copy to a new item then move the copy.
Can I end sub in a event, that ItemChange cannot find item, because it has moved?
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
You can Exit sub or use an error handler to jump out when it hits an error - on error resume next should work.

are you using code like this to create the copy and move it? I was thinking this wouldn't trigger itemchange -but now that you've said it was because it was looking for the copy, I'm not so sure.
Set objCopy = Item.Copy
objCopy.Move objDestFolder
 

jepp

Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
You can Exit sub or use an error handler to jump out when it hits an error - on error resume next should work.

are you using code like this to create the copy and move it? I was thinking this wouldn't trigger itemchange -but now that you've said it was because it was looking for the copy, I'm not so sure.
Set objCopy = Item.Copy
objCopy.Move objDestFolder
I am using code like in your example. The weirdest thing is, that the event isn't fired, if I have a break on NewInspector event, and then go thrue the code step by step. ItemChange event is only fired when code runs uninterupted.
 

jepp

Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
Diane, I have added error handler and just stop sub. Everythink seems to work as it should. But I don't like it. And I am not 100% sure that its over.
I still can't get it, why this event is triggerd by copy/move. And why code works step by step.

Thank you for your help. George.
 

jepp

Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
I see now, that on every error I also have to call ThisOutlookSession.Initialize_Handler
Can this be a problem in heavy usage of Outlook?
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Michael might know (he's the resident VBA expert - i only pretend to play one on tv lol) - but after an error, it will need to re-initialize the handler. If you don't copy the item, does it error and reinitialize?
 

jepp

Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
Michael might know (he's the resident VBA expert - i only pretend to play one on tv lol) - but after an error, it will need to re-initialize the handler. If you don't copy the item, does it error and reinitialize?
Diane, you are correct. There is no error if I dont copy an item.
 

jepp

Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
I have just implemented new boolean variable.
Variable is set True in newInspector event, when the item.copy happens.
When ItemChange triggers (right after newInspector), this variable ends sub. No need for calling Application_Startup().
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
P Aborting ItemChange if ItemRemove Event Handler will be called nex Outlook VBA and Custom Forms 1
C ItemChange Event to Propagate Contacts Outlook VBA and Custom Forms 1
J Outlook 2010 Outlook/Win7 Client logging Event ID 36887 Using Outlook 0
K Recurring all day annual event Using Outlook 3
P Restore an individual all-day recurring event Using Outlook 2
K VBA BeforeItemMove event create rule to always move to its folder. Outlook VBA and Custom Forms 4
K Working with Explorer.Close event Outlook VBA and Custom Forms 3
F Outlook 2016 call to Stop Timer Event Outlook VBA and Custom Forms 4
D Event ID issues Exchange Server Administration 2
T Outlook 2016 Calendar multiday event display Using Outlook 4
oliv- Treat once an email with the ItemAdd event in a shared mailbox Outlook VBA and Custom Forms 2
M Automatically create event in calendar when task is created Outlook VBA and Custom Forms 1
A UID field in iCal files - unique per-event or per-user or both? Using Outlook 2
D help with Item/Inspector close event Outlook VBA and Custom Forms 1
B on flag message event - create task Outlook VBA and Custom Forms 22
Diane Poremsky Change the All Day Event Default Free/Busy to "Busy" New Slipstick.com Articles 3
C Calendar - Centering an event in Outlook? Using Outlook 1
J Outlook calendar...How to add an event or appointment without a border around it? Using Outlook 9
J Create Calendar Alert Event form Mail Subject line? Using Outlook 4
S Item Add Event fires intermittently Outlook VBA and Custom Forms 3
R Why is a meeting organizer me and not the creator of the event? Using Outlook 1
V Calendar event acting odd Using Outlook 7
G Capture "forward event" ? Outlook VBA and Custom Forms 11
P Change the Outlook.com "from" address for calendar event invites Using Outlook 9
20 Ton Squirrel Detect Application_Startup event completion Outlook VBA and Custom Forms 1
L Outlook 2007 All Day Event Using Outlook 27
I Event listener for deleted items Using Outlook 6
M Save Attachments Event? Using Outlook 0
Commodore Calendar Folder property is missing - Event 27 Using Outlook 11
G Quit event code - 2007 Using Outlook 3
J Capturing forward event when multiple items are selected Using Outlook 0
P Trying to get 'Calendar Name' to appear like 'Subject' and 'Location' in event Calendar Printing Assistant 0
G What event happens when you open 2 copies of your inbox? Using Outlook 5
D Adding a participant automatically to a calendar event Using Outlook 1
H Changing Organizer of event (for single to total calendar move; long way ) Exchange Server Administration 4
N Combobox in outlook add ons toolbar not firing event on main window resized Using Outlook 3
D Extracting Location info from All Day Event in mailboxes into webpage Exchange Server Administration 3
H Conflicts with other event in calendar ( outlook 2007 & 2010) Using Outlook 0
B Restoring Deleted Recurring Event AND Notes Using Outlook 8
Q Looking for Outlook 2010 Close Event Id Exchange Server Administration 1
S Outlook Recurring event Using Outlook 1
D Task and Event View in Outlook 2010? Using Outlook 3
I Event ID 2937 after update to Exchange 2010 SP1 ArbitrationMailbox Exchange Server Administration 4
S Error starting MS Outlook - Problem Event Name CLR20R3 Using Outlook 2
I Event ID 14031 logged after transition to Exchange 2010 Exchange Server Administration 4
J Recurring event (from 2006 and deleted multiple times) continues to send me multiple reminders Using Outlook 1
I Event ID 2937 after update to Exchange 2010 SP1 Exchange Server Administration 8
0 trying to get rid of the "end" time of each event within each day on the calendar. This shows up wh Using Outlook 1
Y MSExchange AuditLogsearch Event ID:4002 Exchange Server Administration 0
A "Item could not be found" error when attempting to send Outlook 2007 calendar event update Using Outlook 2
Similar threads


















































Top