calculate elapsed time in word without macros?

I am creating a form in word that has a date field for 'starttime' and 'endtime' that display as hh:mm AM/PM.  Is there any way to have the form automatically calculate the elapsed time without using a macro?  (I'm creating a template and thus new documents lose the macro.)  Not sure this is even possible but figured I could ask.  Thanks!

To see how to do this and just about everything else you might want to do with dates & times in Word using field codes instead of macros, check out my Microsoft Word Date Calculation Tutorial, at:
http://windowssecrets.com/forums/showthread.php/154368-Microsoft-Word-Date-Calculation-Tutorial
or:
http://www.gmayor.com/downloads.htm#Third_party
In particular, look at the item titled 'Add Or Subtract Two Time Periods'. Do read the document's introductory material.

Note: To use this approach with a non-macro form, you'd need to use formfields and forms protection. The formfields would need their 'calculate on exit' property checked.

Cheers
Paul Edstein
(Fmr MS MVP - Word)

2 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Addressing the statement "(I'm creating a template and thus new documents lose the macro.)": That would be true only if you send the documents to other computers that don't have access to the template. Even then, it would matter only if the macro has to run on those other computers, rather than producing some output as static text in the document before you send it out.

If you're supplying the template to other computers, where it will be used to create new documents, again it doesn't matter that the macro is only in the template -- it will run there and produce text in those documents.

_____________________________
https://jay-freedman.info

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated March 16, 2022 Views 832 Applies to: