Temporarily ignoring items events?

M

Mark

During initialization, our add-in creates global object IDs for any
relevant appointments that don't have them, in case the entry IDs
later change. However this action itself triggers an item-changed
event. I tried calling Unadvise() on the Items object before making
these changes and then Advise() afterwards, but the events are still
triggered--possibly because Outlook only decides what events to send
after all our initialization code is run. Is there some way I can
ensure that particular changes won't trigger events? My workaround
right now is to remember all the global object IDs we created, then
ignore the first item-changed event for any items in the list, but I
don't much like this solution and would prefer something slightly more
elegant.

Mark
 
M

Mark

You know I actually tried that as well, but I guess I still set them
up too quickly after my initialization code, as it still caught all
the item-changed events. It was pretty surprising, but I don't think
I made a mistake. I guess there is a window after which it would skip
them, but I don't want to implement a timing-based fix with no
guarantees.

There is also the fact that such a solution would require more state
in the add-in, since we'd have to remember if we'd already
initialized, which we only do once when our main application is
installed. I'd like to avoid that, but it is a better solution than
my current one, if I could get it to work. I'll try again in case I
was hallucinating earlier, which is possible.

Mark
 
M

Mark

Okay, seems I am crazy. Not sure what I did differently the first
time I tried it, but it does seem to be okay to set the event handlers
after the initialization code.

Thanks!
Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top