why appointment.LastModificationTime isn't changed?

C

Cynthia

I am using Outlook2003. I just want to know how could I judge whether a
appointment has been modified? I have tried to write Save() method in code
and click "Save" button in menu, but these both did not change the
LastModificationTime. It is always equal to CreationTime.

How could I do?

Thanks
 
D

Dmitry Streblechenko

Try to release the object by setting it to Nothing in VB (or null in .Net
with a subsequent call to Marshal.ReleaseCOMObject), then reopen it using
Namespace,GetItemFromID.

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

Cynthia

Thanks for your reply


I have tried your code in my developing environment. But it didn't work very
well :-( I found a problem: I created a new appointment in my code with C#,
and set its recurrence property, then saved it and displayd it (Because I
found in C#, if I want to create a recurring appointment, I must set its
recurrence property and save it before displaying, is it Right??). After
opening it, I also added some properties into the current active appointment.
When closing it, I saved the new properties and compared LastModificationTime
with CreationTime, they were also same.



But if I reopen the appointment from my Calendar, I modified and saved, the
LastModificationTime and CreationTime were not same.



So how could I get the correct LastModificationTime when I create new
appointment and modified some properties?



Thank you very much
 
D

Dmitry Streblechenko

Same answer:

Try to release the object by setting it to Nothing in VB (or null in .Net
with a subsequent call to Marshal.ReleaseCOMObject), then reopen it using
Namespace,GetItemFromID.

Since you are using .Net, the COM objects are released later by the GC.
Avoid using multiple dot notation, release all object explicitly using
Marshal.ReleaseCOMObject, call GC.Collect. Then reopen the item using
Namespace.GetItemFromID.

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

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