View Single Post
 
Old 09-02-2014, 07:48 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

If you're using formfields, the document will already require Forms protection. In that case, you could use another text formfield for both the 'button' and the approval text.

For example, if you insert such a formfield and make its default text:
Click Here to Approve
you could attach an on-entry macro to it, coded as follows:
Code:
Sub Approval()
With ActiveDocument.FormFields("Text1")
  .Result = "Approved by " & Environ("Username") & " on " & Format(Now(), "DDDD, D MMMM YYYY @ hh:mm")
  .Enabled = False
End With
End Sub
where the formfield's internal bookmark name is 'Text1'.

Do note that, as coded, only the approval formfield is locked.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote