Delphi and Outlook TaskItem: how to tell if a DueDate is empty?
This doesn't seem to be a problem, but I couldn't find anything on it.
How to determine if a date option in Outlook is "blank"? For example TaskItem.DueDate - duedate is optional.
If it is blank, Outlook returns "4501.01.01". - I can check this value, but it just doesn't seem "elegant".
Thanks!
a source to share
1/1/4501 is the value that Outlook uses for DATE_NONE. Many documents on MSDN deal with this implementation detail.
a source to share
If that's what it returns when the date is not full, then this is probably the easiest way to test it. If that means your code will turn out to be less graceful than it should be (and I agree it is), then it's a good thing Microsoft's fault, not yours.
One thing that will make the code look better is to declare it 4501.01.01
as const . Give it a name EMPTY_DATE
or something, and then check your code for EMPTY_DATE
a letter instead of. So it is obvious that you are checking when you read the code.
a source to share