Are you sure that you're not supposed to get one of many items (i.e. an array), not just the first? For example:
Set ItemDate = newFolder.Items(X).GetFirst
Where X is the array number (probably starting at zero)?
What I'm saying is that maybe NewFolder is not ONLY the date, but four or five items. And perhaps the date is the third item. Therefore, in that scenario:
Set ItemDate = newFolder.Items(2).GetFirst
Check to make sure what you're actually getting when you declare
Set newFolder = ofFolder.GetFirst
My guess is you're getting more than only a date and you need to specify which one of the items you want. If you don't, you get the first thing, i.e. subject header. Since subject header is a string and not a date, you get the mismatch error when you use the DateValue function.
Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
|