View Single Post
  #9  
Old January 18th 08, 02:52 PM posted to microsoft.public.outlook.program_addins
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Folder last modification date

FWIW, I don't see PR_LAST_MODIFICATION_TIME on any .pst folders. Could that be the issue?

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Ken Slovak - [MVP - Outlook]" wrote in message ...
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.



"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