View Single Post
  #8  
Old January 18th 08, 02:08 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Folder last modification date

Well, something's wrong. I'm not sure what. Using OutlookSpy and clicking on
IMAPIFolder and scrolling down to PR_LAST_MODIFICATION_TIME (listed
alphabetically among the named properties) I see a value there in GetProps
in the default Contacts folder. I also see that property in every other
folder in my mailbox, default or non-default.

Where is your code running? What application is hosting that VBA? If it's
Outlook VBA do not use CreateObject("Outlook.Application"), use the
intrinsic Application object provided by the Outlook VBA. Use CreateObject
only if running in some other VBA environment, such as Word or Excel VBA.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"ck" wrote in message
...
Ken,

Thank you for the explanation and code snippet. I have

Change - oSession.MAPIOBJECT = Application.Session.MAPIOBJECT

To - oAppl.GetNamespace("MAPI").MAPIOBJECT

The oFolder.Fields(&H30080040) still = Empty.

Probably something is wrong with my Outlook.

Just to confirm with you, i used OutlookSpy (IMAPIFolder) to check default
contact folder.

The GetProps tab doesn't have any PR_LAST_MODIFICATION_TIME property. How
do
you check the value?

Thanks.


My code:

Dim oAppl As Outlook.Application
Dim oSession As Redemption.RDOSession
Dim oFolder As Redemption.RDOFolder
Dim oUtils As Redemption.MAPIUtils
Dim lastMod As Date
'
Set oAppl = CreateObject("Outlook.Application")
Set oSession = CreateObject("Redemption.RDOSession")
'oSession.MAPIOBJECT = Application.Session.MAPIOBJECT
oSession.MAPIOBJECT = oAppl.GetNamespace("MAPI").MAPIOBJECT
Set oUtils = CreateObject("Redemption.MAPIUtils")
oUtils.MAPIOBJECT = oSession.MAPIOBJECT
'
Set oFolder = oSession.GetDefaultFolder(olFolderContacts)
lastMod = oFolder.fields(&H30080040)
Debug.Print "UTC time: " & CStr(lastMod)
lastMod = oUtils.HrGMTToLocal(lastMod)
Debug.Print "local time: " & CStr(lastMod)


Ads