Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modified date of Outlook notes folder

Status
Not open for further replies.

may1hem

Programmer
Jul 28, 2002
262
GB
My application loads over a thousand notes (from an Outlook notes folder) into memory each time it runs, which is slow. What I want to do is load the notes into memory once and then each time I use the application it should check the last modified date/time of the folder to see if anything has changed in the folder since the application was last run. If something has changed then it should spend the time to re-load the notes into memory.

I've searched through the object browser but the folder object doesn't have a date modified property. How can I find the last modified date/time of a notes folder in Outlook 2007?

Thanks,
May
 
may1hem,
Try looking at the [tt]Restrict[/tt] method. You should be able to use it to isolate any notes that have been updated since the Last Load time.

Code:
  ...
  strFilter = "[LastModificationTime] > " & Format$([i]Last Load time[/i], "'m/d/yyyy'")

  Set objFolder = objOutlook.GetNamespace("MAPI").GetDefaultFolder(olFolderNotes)
  Set objRestrictedItems = objFolder.Items.Restrict(strFilter)
  For Each objNoteItem In objRestrictedItems
    'You can reload the details here
  Next objNoteItem
  ...

Hope this helps,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top