Task Form - date completed

M

Michael Yorke

Hi,

I am designing a custom task form and having a bit of
trouble with the "created time" and "completed time".

The created time gets entered automatically when the form
is opened, this is fine.

I also have a Completed tick box and completed text box.
The idea here being that when someone ticks
the "Completed" box the current date & time gets entered
into the completed text box. So far though I can only
get the current date to appear and not the current time.

Also I would like to calculate the difference between
those times, giving me the length of time the task took
to complete. and have it displayed as "1 day, 3 hours,
10 minutes" for example.

I think I know how to do this calculation from reading
Microsoft Outlook Programming by Sue Mosher but I need to
get the value of the completed date and time first in
order to calculate how long the task took to complete.

Any help on both queries is greatly appreciated.

Mike
 
S

Sue Mosher [MVP-Outlook]

Outlook does not store any time element in the TaskItem.DateCompleted
property. You can't change that behavior.
 
G

Guest

Thanks Sue,

shame that outlook doesn't store the time element.
Presumably though I can write some code to enter the
current date and time when I click something (like a tick
box)?

I can then use this to compare with the start time and
workout how long a task took to complete?

Mike.
 
S

Sue Mosher [MVP-Outlook]

You can use code in the PropertyChange event to put the current date/time
(Now()) in a custom field when the item is marked complete. If you're not
familiar with that event, see http://www.outlookcode.com/d/propsyntax.htm

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top