This looks related to the string encoding that's returned from GetDetailsOf()
. I didn't spend a lot of time trying to figure out what it was. Instead, I just stripped out any non-date characters by using a regex. Here's an example:
Dim re
Set re = New RegExp
re.Global = True
re.Pattern = "[^/0-9]" ' Assuming regional settings use "/" for separator
d = objFolder.GetDetailsOf(objItem, 2)
' Split by space char and return first element to get date only...
d = Split(d, " ")(0)
' Remove any non-date chars...
d = re.Replace(d, "")
MsgBox DateDiff("d", d, Date) ' Works!
Of course, you could combine everything into a single statement:
d = re.Replace(Split(objFolder.GetDetailsOf(objItem, 2), " ")(0), "")