|
-
Jul 5th, 2006, 10:49 PM
#1
Thread Starter
New Member
-
Jul 6th, 2006, 02:43 AM
#2
Re: Help!! Attempting to Protect Document in Word using VB, but only after pre-requisite
you could have the template protected, then on document open run a macro to unprotect, update the field and set protection again
VB Code:
ActiveDocument.Protect Password:="", NoReset:=False, Type:= _
wdAllowOnlyFormFields
to protect document for forms
VB Code:
ActiveDocument.Unprotect Password:=""
pete
-
Jul 6th, 2006, 10:10 PM
#3
Thread Starter
New Member
Re: Help!! Attempting to Protect Document in Word using VB, but only after pre-requis
Thanks for your input Pete - here's the script I have written at the moment:
VB Code:
Sub ProtectDoc()
If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect _
Type:=wdAllowOnlyFormFields, NoReset:=True
End If
End Sub
My problem is that I want this to activate about 8 seconds after the person opens the document. (The document is unprotected upon opening)... how do I do this (with no manual intervention)?
-
Jul 7th, 2006, 02:38 AM
#4
Re: Help!! Attempting to Protect Document in Word using VB, but only after pre-requisite
put your code into the "this document" open sub
if need be put a loop to detect when whatever you are waiting for has finished, then protect
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|