Dysentery
11-21-2014, 01:35 PM
Hello all,
First of all, TOTAL visual basic noob here. I'm working on creating a form for employees to fill out in Word 2013. I need the form to time/date stamp itself when the user fills out the form. However, I do not want that time/date stamp to update every time someone else opens that document. In other words, if it is blank it needs to auto stamp the time and date. After that person using the form emails it to me, when I open it I want to see the time/date the form was filled out, not the date/time I open it.
This will be a protected document with many, many form fields for the user to tab through and fill out, then submit to me via email.
I had something similar set up on an excel spreadsheet, with this code:
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Unprotect ("password")
If Range("I5") = "" Then
Range("I5") = Now
End If
ActiveSheet.Protect ("password")
End Sub
It worked great. the time/date stamp would be added when someone began filling in the spreadsheet and would not update when I opened it.
Would this be the right approach for adding this functionality to a protected Word doc? I know next to nothing about code. Could anyone help?
First of all, TOTAL visual basic noob here. I'm working on creating a form for employees to fill out in Word 2013. I need the form to time/date stamp itself when the user fills out the form. However, I do not want that time/date stamp to update every time someone else opens that document. In other words, if it is blank it needs to auto stamp the time and date. After that person using the form emails it to me, when I open it I want to see the time/date the form was filled out, not the date/time I open it.
This will be a protected document with many, many form fields for the user to tab through and fill out, then submit to me via email.
I had something similar set up on an excel spreadsheet, with this code:
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Unprotect ("password")
If Range("I5") = "" Then
Range("I5") = Now
End If
ActiveSheet.Protect ("password")
End Sub
It worked great. the time/date stamp would be added when someone began filling in the spreadsheet and would not update when I opened it.
Would this be the right approach for adding this functionality to a protected Word doc? I know next to nothing about code. Could anyone help?