A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

ItemChange and Exchange synchronization



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 14th 06, 06:58 AM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default ItemChange and Exchange synchronization

I sam confused - why would ItemChange fire if you did not change it again?
Or if a new change did not come from the EX server?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Rog" wrote in message ...
Thanks Dmitry for your response. Well basically once a user does a save I
capture the ItemChange event and log the item that was change to a local
db. Then when they click a button I try to sync to the contact up to a
server based on the values from the local db file. In addition to syncing
from outlok I also sync down from the server to outlook and save the item.
During the syncing I set a flag so anything that is saved will not trigged
the ItemChange event, but once my sync process is complete, I change the
flag to capture the next time someone modifies a contact. So the problem
is about 30 secs after my sync process is complete and the flag is reset,
Outlook syncs with exchange which causes the ItemChange event to fire and
me to resave the item as modified in my local b file which triggers the
whole process over again when nothing has really changed.
Does that make sense?

Dmitry Streblechenko wrote:
No, the cached Exchange provider provides no notification.
Why wouldn't you want to run your code? Does it matter whether a change
occured because the current user modified an item or because it got
modified on a different machine and the Exchange provider received the
notification and updated the local copy?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Rog" wrote in message
...
I am using the ItemChange event in my C# code to capture when an item is
saved and then do something with it. The problem is I do not want to do
this action when Exchange is syncing. Is there anyway to determine when
exchange is doing its auto-sync so i can not run the code?
Thanks so much



  #2  
Old October 14th 06, 07:16 AM posted to microsoft.public.outlook.program_addins
Rog
external usenet poster
 
Posts: 62
Default ItemChange and Exchange synchronization

Thanks Dmitry, so what happens is I save the contact in the code,
ItemChange fires, of course, but b/c my flag is set, I do not resave it
again to my local db. But then it seems b/c I just saved the Contact
about 30 seconds later the ItemChange event fires b/c it seems that
Exchange is doing the synchronization.
Does this make sense?


Dmitry Streblechenko wrote:
I sam confused - why would ItemChange fire if you did not change it again?
Or if a new change did not come from the EX server?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Rog" wrote in message ...
Thanks Dmitry for your response. Well basically once a user does a save I
capture the ItemChange event and log the item that was change to a local
db. Then when they click a button I try to sync to the contact up to a
server based on the values from the local db file. In addition to syncing
from outlok I also sync down from the server to outlook and save the item.
During the syncing I set a flag so anything that is saved will not trigged
the ItemChange event, but once my sync process is complete, I change the
flag to capture the next time someone modifies a contact. So the problem
is about 30 secs after my sync process is complete and the flag is reset,
Outlook syncs with exchange which causes the ItemChange event to fire and
me to resave the item as modified in my local b file which triggers the
whole process over again when nothing has really changed.
Does that make sense?

Dmitry Streblechenko wrote:
No, the cached Exchange provider provides no notification.
Why wouldn't you want to run your code? Does it matter whether a change
occured because the current user modified an item or because it got
modified on a different machine and the Exchange provider received the
notification and updated the local copy?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Rog" wrote in message
...
I am using the ItemChange event in my C# code to capture when an item is
saved and then do something with it. The problem is I do not want to do
this action when Exchange is syncing. Is there anyway to determine when
exchange is doing its auto-sync so i can not run the code?
Thanks so much


  #3  
Old October 14th 06, 08:15 AM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default ItemChange and Exchange synchronization

Hmmm.. I do not see that secondd event in the cached mode...
I guess you could store a hash made out of the values that you care about
(e.g .Email1Address + FileAs + ...) - if the hash is still the same, do
nothing.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Rog" wrote in message ...
Thanks Dmitry, so what happens is I save the contact in the code,
ItemChange fires, of course, but b/c my flag is set, I do not resave it
again to my local db. But then it seems b/c I just saved the Contact about
30 seconds later the ItemChange event fires b/c it seems that Exchange is
doing the synchronization.
Does this make sense?


Dmitry Streblechenko wrote:
I sam confused - why would ItemChange fire if you did not change it
again? Or if a new change did not come from the EX server?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Rog" wrote in message
...
Thanks Dmitry for your response. Well basically once a user does a save
I capture the ItemChange event and log the item that was change to a
local db. Then when they click a button I try to sync to the contact up
to a server based on the values from the local db file. In addition to
syncing from outlok I also sync down from the server to outlook and save
the item. During the syncing I set a flag so anything that is saved will
not trigged the ItemChange event, but once my sync process is complete,
I change the flag to capture the next time someone modifies a contact.
So the problem is about 30 secs after my sync process is complete and
the flag is reset, Outlook syncs with exchange which causes the
ItemChange event to fire and me to resave the item as modified in my
local b file which triggers the whole process over again when nothing
has really changed.
Does that make sense?

Dmitry Streblechenko wrote:
No, the cached Exchange provider provides no notification.
Why wouldn't you want to run your code? Does it matter whether a change
occured because the current user modified an item or because it got
modified on a different machine and the Exchange provider received the
notification and updated the local copy?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Rog" wrote in message
...
I am using the ItemChange event in my C# code to capture when an item
is saved and then do something with it. The problem is I do not want
to do this action when Exchange is syncing. Is there anyway to
determine when exchange is doing its auto-sync so i can not run the
code?
Thanks so much




  #4  
Old October 16th 06, 06:05 AM posted to microsoft.public.outlook.program_addins
Rog
external usenet poster
 
Posts: 62
Default ItemChange and Exchange synchronization

Good suggestion Dmitry, so does that mean there is no way to catch this
exchange sync event programmatically within Outlook? If I triggered the
exchange sync to happen so that I could control my flag and not save to
my local db file, would I be able to prevent it from happening at
another time besides when the user saves the item?
Rog

Dmitry Streblechenko wrote:
Hmmm.. I do not see that secondd event in the cached mode...
I guess you could store a hash made out of the values that you care about
(e.g .Email1Address + FileAs + ...) - if the hash is still the same, do
nothing.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Rog" wrote in message ...
Thanks Dmitry, so what happens is I save the contact in the code,
ItemChange fires, of course, but b/c my flag is set, I do not resave it
again to my local db. But then it seems b/c I just saved the Contact about
30 seconds later the ItemChange event fires b/c it seems that Exchange is
doing the synchronization.
Does this make sense?


Dmitry Streblechenko wrote:
I sam confused - why would ItemChange fire if you did not change it
again? Or if a new change did not come from the EX server?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Rog" wrote in message
...
Thanks Dmitry for your response. Well basically once a user does a save
I capture the ItemChange event and log the item that was change to a
local db. Then when they click a button I try to sync to the contact up
to a server based on the values from the local db file. In addition to
syncing from outlok I also sync down from the server to outlook and save
the item. During the syncing I set a flag so anything that is saved will
not trigged the ItemChange event, but once my sync process is complete,
I change the flag to capture the next time someone modifies a contact.
So the problem is about 30 secs after my sync process is complete and
the flag is reset, Outlook syncs with exchange which causes the
ItemChange event to fire and me to resave the item as modified in my
local b file which triggers the whole process over again when nothing
has really changed.
Does that make sense?

Dmitry Streblechenko wrote:
No, the cached Exchange provider provides no notification.
Why wouldn't you want to run your code? Does it matter whether a change
occured because the current user modified an item or because it got
modified on a different machine and the Exchange provider received the
notification and updated the local copy?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Rog" wrote in message
...
I am using the ItemChange event in my C# code to capture when an item
is saved and then do something with it. The problem is I do not want
to do this action when Exchange is syncing. Is there anyway to
determine when exchange is doing its auto-sync so i can not run the
code?
Thanks so much



  #5  
Old October 16th 06, 07:13 AM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default ItemChange and Exchange synchronization

No, you wouldn't be able to know what exactly caused that event to fire.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Rog" wrote in message ...
Good suggestion Dmitry, so does that mean there is no way to catch this
exchange sync event programmatically within Outlook? If I triggered the
exchange sync to happen so that I could control my flag and not save to my
local db file, would I be able to prevent it from happening at another
time besides when the user saves the item?
Rog

Dmitry Streblechenko wrote:
Hmmm.. I do not see that secondd event in the cached mode...
I guess you could store a hash made out of the values that you care about
(e.g .Email1Address + FileAs + ...) - if the hash is still the same, do
nothing.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Rog" wrote in message
...
Thanks Dmitry, so what happens is I save the contact in the code,
ItemChange fires, of course, but b/c my flag is set, I do not resave it
again to my local db. But then it seems b/c I just saved the Contact
about 30 seconds later the ItemChange event fires b/c it seems that
Exchange is doing the synchronization.
Does this make sense?


Dmitry Streblechenko wrote:
I sam confused - why would ItemChange fire if you did not change it
again? Or if a new change did not come from the EX server?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Rog" wrote in message
...
Thanks Dmitry for your response. Well basically once a user does a
save I capture the ItemChange event and log the item that was change
to a local db. Then when they click a button I try to sync to the
contact up to a server based on the values from the local db file. In
addition to syncing from outlok I also sync down from the server to
outlook and save the item. During the syncing I set a flag so anything
that is saved will not trigged the ItemChange event, but once my sync
process is complete, I change the flag to capture the next time
someone modifies a contact. So the problem is about 30 secs after my
sync process is complete and the flag is reset, Outlook syncs with
exchange which causes the ItemChange event to fire and me to resave
the item as modified in my local b file which triggers the whole
process over again when nothing has really changed.
Does that make sense?

Dmitry Streblechenko wrote:
No, the cached Exchange provider provides no notification.
Why wouldn't you want to run your code? Does it matter whether a
change occured because the current user modified an item or because
it got modified on a different machine and the Exchange provider
received the notification and updated the local copy?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Rog" wrote in message
...
I am using the ItemChange event in my C# code to capture when an
item is saved and then do something with it. The problem is I do not
want to do this action when Exchange is syncing. Is there anyway to
determine when exchange is doing its auto-sync so i can not run the
code?
Thanks so much



  #6  
Old October 16th 06, 07:00 PM posted to microsoft.public.outlook.program_addins
Rog
external usenet poster
 
Posts: 62
Default ItemChange and Exchange synchronization

Thanks Dmitry for your help, I figured I would post back what I ended up
implementing. For whatever reason i had forgotten, code bloat
possibly, that I had kept a lastsyncdate variable so in the ItemChange
handler I check the lastmodificationTime of the outlook object against
the last sync date, if the modtime is greater I save to my db file
otherwise I do not nothing.
Thanks,
Rog

Dmitry Streblechenko wrote:
No, you wouldn't be able to know what exactly caused that event to fire.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Rog" wrote in message ...
Good suggestion Dmitry, so does that mean there is no way to catch this
exchange sync event programmatically within Outlook? If I triggered the
exchange sync to happen so that I could control my flag and not save to my
local db file, would I be able to prevent it from happening at another
time besides when the user saves the item?
Rog

Dmitry Streblechenko wrote:
Hmmm.. I do not see that secondd event in the cached mode...
I guess you could store a hash made out of the values that you care about
(e.g .Email1Address + FileAs + ...) - if the hash is still the same, do
nothing.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Rog" wrote in message
...
Thanks Dmitry, so what happens is I save the contact in the code,
ItemChange fires, of course, but b/c my flag is set, I do not resave it
again to my local db. But then it seems b/c I just saved the Contact
about 30 seconds later the ItemChange event fires b/c it seems that
Exchange is doing the synchronization.
Does this make sense?


Dmitry Streblechenko wrote:
I sam confused - why would ItemChange fire if you did not change it
again? Or if a new change did not come from the EX server?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Rog" wrote in message
...
Thanks Dmitry for your response. Well basically once a user does a
save I capture the ItemChange event and log the item that was change
to a local db. Then when they click a button I try to sync to the
contact up to a server based on the values from the local db file. In
addition to syncing from outlok I also sync down from the server to
outlook and save the item. During the syncing I set a flag so anything
that is saved will not trigged the ItemChange event, but once my sync
process is complete, I change the flag to capture the next time
someone modifies a contact. So the problem is about 30 secs after my
sync process is complete and the flag is reset, Outlook syncs with
exchange which causes the ItemChange event to fire and me to resave
the item as modified in my local b file which triggers the whole
process over again when nothing has really changed.
Does that make sense?

Dmitry Streblechenko wrote:
No, the cached Exchange provider provides no notification.
Why wouldn't you want to run your code? Does it matter whether a
change occured because the current user modified an item or because
it got modified on a different machine and the Exchange provider
received the notification and updated the local copy?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Rog" wrote in message
...
I am using the ItemChange event in my C# code to capture when an
item is saved and then do something with it. The problem is I do not
want to do this action when Exchange is syncing. Is there anyway to
determine when exchange is doing its auto-sync so i can not run the
code?
Thanks so much


  #7  
Old October 16th 06, 09:17 PM posted to microsoft.public.outlook.program_addins
Rog
external usenet poster
 
Posts: 62
Default ItemChange and Exchange synchronization

I think I spoke to soon on this one. if the exchange server time is off
or it is trying to sync objects down from exchange the
lastmodificationtime will be greater that the local sync date time.
back to square one. Anyone have any other ideas?
Rog

Rog wrote:
Thanks Dmitry for your help, I figured I would post back what I ended up
implementing. For whatever reason i had forgotten, code bloat possibly,
that I had kept a lastsyncdate variable so in the ItemChange handler I
check the lastmodificationTime of the outlook object against the last
sync date, if the modtime is greater I save to my db file otherwise I do
not nothing.
Thanks,
Rog

Dmitry Streblechenko wrote:
No, you wouldn't be able to know what exactly caused that event to fire.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Rog" wrote in message
...
Good suggestion Dmitry, so does that mean there is no way to catch
this exchange sync event programmatically within Outlook? If I
triggered the exchange sync to happen so that I could control my flag
and not save to my local db file, would I be able to prevent it from
happening at another time besides when the user saves the item?
Rog

Dmitry Streblechenko wrote:
Hmmm.. I do not see that secondd event in the cached mode...
I guess you could store a hash made out of the values that you care
about (e.g .Email1Address + FileAs + ...) - if the hash is still the
same, do nothing.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Rog" wrote in message
...
Thanks Dmitry, so what happens is I save the contact in the code,
ItemChange fires, of course, but b/c my flag is set, I do not
resave it again to my local db. But then it seems b/c I just saved
the Contact about 30 seconds later the ItemChange event fires b/c
it seems that Exchange is doing the synchronization.
Does this make sense?


Dmitry Streblechenko wrote:
I sam confused - why would ItemChange fire if you did not change
it again? Or if a new change did not come from the EX server?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Rog" wrote in message
...
Thanks Dmitry for your response. Well basically once a user does
a save I capture the ItemChange event and log the item that was
change to a local db. Then when they click a button I try to sync
to the contact up to a server based on the values from the local
db file. In addition to syncing from outlok I also sync down from
the server to outlook and save the item. During the syncing I set
a flag so anything that is saved will not trigged the ItemChange
event, but once my sync process is complete, I change the flag to
capture the next time someone modifies a contact. So the problem
is about 30 secs after my sync process is complete and the flag
is reset, Outlook syncs with exchange which causes the ItemChange
event to fire and me to resave the item as modified in my local b
file which triggers the whole process over again when nothing has
really changed.
Does that make sense?

Dmitry Streblechenko wrote:
No, the cached Exchange provider provides no notification.
Why wouldn't you want to run your code? Does it matter whether a
change occured because the current user modified an item or
because it got modified on a different machine and the Exchange
provider received the notification and updated the local copy?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Rog" wrote in message
...
I am using the ItemChange event in my C# code to capture when
an item is saved and then do something with it. The problem is
I do not want to do this action when Exchange is syncing. Is
there anyway to determine when exchange is doing its auto-sync
so i can not run the code?
Thanks so much


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Exchange offline address book synchronization JohnGregor Outlook - Using Contacts 1 July 15th 06 07:14 PM
folder synchronization Jon Andresen Outlook - Installation 0 May 4th 06 05:56 PM
MapiFolder Items ItemChange is not firing AtulSureka Outlook - Using Forms 1 February 6th 06 05:32 PM
Mapi Folder Items ItemChange event is not firing AtulSureka Outlook and VBA 3 February 5th 06 07:25 PM
Outlook-Exchange Synchronization Dan Outlook - Installation 1 February 2nd 06 03:33 AM


All times are GMT +1. The time now is 01:28 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.