Link to home
Start Free TrialLog in
Avatar of Arnel Mamaril
Arnel Mamaril

asked on

Please help me display the number of days between two dates from Date Picker Content Control in a Microsoft Word 2013 Document.

Please help me display the number of days between two dates from Date Picker Content Control in a Microsoft Word 2013 Document.
Avatar of Eirman
Eirman
Flag of Ireland image

You can do some date calculations with fields in Word, but unlike excel/access it's awkward and complicated.
http://wordribbon.tips.net/T008660_Calculating_Dates_with_Fields.html
http://www.addbalance.com/word/datefields2.htm

I use this site for date calculations.
do you have a sample to upload to show how's your document would look like and how the output you want to be displayed?

are you ok if macro is involved in the document?
Avatar of Arnel Mamaril
Arnel Mamaril

ASKER

Hello Ryan,
Thank you for your message.  Attached herewith is the sample document.  I'm ok involving a macro in the document.
Days-Calculation.docx
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
the closest I can get is to call the Document_ContentControlOnExit event:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
    Call test
End Sub

Open in new window

or you may referring and do some research on this article and see if we really can improve from there

Content Control Custom Events
http://maxey.mvps.org/word_tip_pages/Old_Tip_Pages/ContentControl_OnChange_Event.htm
Thank you very much Ryan, it worked pretty well :)
Much appreciated