View Single Post
  #6  
Old May 14th 07, 02:30 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default itemchange event in public (exchange) folder occurs if nothing is changed

Code in ThisOutlookSession also should use the intrinsic Application object
and not create an Outlook.Application object.

Something you are running, whether it's the sync code or something else is
changing the items or Item.Change wouldn't fire.

If you declare an item object WithEvents you can handle the events for that
item. So for a MailItem:

Dim WithEvents oMail as Outlook.MailItem

Then in the NewInspector event handler:
If Inspector.Class = olMail Then
Set oMail = Inspector.CurrentItem
End If

Select oMail in the drop-down at the top left of the code window and in the
right-hand drop-down select the PropertyChange event. You can also select
CustomPropertyChange. Write code for those event handlers to see which
properties are being changed. The property name is passed to you as Name in
those events.

--
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


"MIchael" wrote in message
...
Hello Ken,
Thats not an addin, its only code in thisoutlooksession
(DieseOutlookSitzung in German:-)
I changed the program thats shelled for testing to Shell
"c:\windows\system32\calc.exe"
the windows calculator. And its just the same .
If I open an contact the event is firing ;-((
But the funny thing is that not every time when I open the contact it is
firing it seems to do it randomly.
the first 5 times opening any contact- not firing
2 times opening - firing
2 more times opening an other contact not firing...................

Sorry but I cant do anything with your proposal
"To debug it I'd probably set handlers on the items being changed to
handle the PropertyChange event."
I am beginner :-((
Maybe you could give me an other hint what do you mean by "to set
handlers"??
Thank you very much for your help!!
Michael


Ads