VBA to track changes in unprotected sections only?

W

Whitney Serio

We use a word form for people in the field, who fill it out then return it
to a reviewer. One of the reviewers would like to be able to use track
changes...

Is it possible to allow the reviewer to only have access to unprotected
sections in track changes?

I realize i could use a snippet to provide the ability to unlock the doc,
and relock it in track changes- (and in fact do this here in office) but
then i have the problem of how to allow the reviewer to accept changes
without unlocking the document for the reviewer (which we want to avoid).

Any ideas?
 
M

macropod

Hi Whitney,

You could try something along the following lines:
1. Insert the following macro into the fiel's 'This Document' module:
Private Sub Document_Open()
Pwd = "Password"
End Sub
replacing 'Password' with the real password.

2. Add the following subs to a standard vba module for the file:
Public Pwd As String

Sub TrkOff()
With ActiveDocument
.Unprotect Password:=Pwd
.TrackRevisions = False
.Protect Type:=wdAllowOnlyFormFields, noreset:=True, Password:=Pwd
End With
End Sub

Sub TrkOn()
With ActiveDocument
.Unprotect Password:=Pwd
.TrackRevisions = True
.Protect Type:=wdAllowOnlyFormFields, noreset:=True, Password:=Pwd
End With
End Sub

3. Make the 'TrkOff' macro the 'On Entry' macro and the 'TrkOn' macro the 'On Exit' macro for every formfield

4. Save, close & re-open the document. Now, whenever you tab out of a formfield into an unprotected Section, change tracking should
be active, but it won't be when working with the formfields in the protected Sections.
 
W

Whitney Serio

Macropod,

(Obviously I have been side tracked with other projects). The plan you
supplied would force the reviewer to tab through form fields that they need
not review in this way.

Is there a way I could create an add-in for example that would allow the
user to turn track changes on but only for unprotected sections?


macropod said:
Hi Whitney,

You could try something along the following lines:
1. Insert the following macro into the fiel's 'This Document' module:
Private Sub Document_Open()
Pwd = "Password"
End Sub
replacing 'Password' with the real password.

2. Add the following subs to a standard vba module for the file:
Public Pwd As String

Sub TrkOff()
With ActiveDocument
.Unprotect Password:=Pwd
.TrackRevisions = False
.Protect Type:=wdAllowOnlyFormFields, noreset:=True, Password:=Pwd
End With
End Sub

Sub TrkOn()
With ActiveDocument
.Unprotect Password:=Pwd
.TrackRevisions = True
.Protect Type:=wdAllowOnlyFormFields, noreset:=True, Password:=Pwd
End With
End Sub

3. Make the 'TrkOff' macro the 'On Entry' macro and the 'TrkOn' macro the
'On Exit' macro for every formfield

4. Save, close & re-open the document. Now, whenever you tab out of a
formfield into an unprotected Section, change tracking should be active,
but it won't be when working with the formfields in the protected
Sections.

--
Cheers
macropod
[Microsoft MVP - Word]


Whitney Serio said:
We use a word form for people in the field, who fill it out then return
it to a reviewer. One of the reviewers would like to be able to use
track changes...

Is it possible to allow the reviewer to only have access to unprotected
sections in track changes?

I realize i could use a snippet to provide the ability to unlock the doc,
and relock it in track changes- (and in fact do this here in office) but
then i have the problem of how to allow the reviewer to accept changes
without unlocking the document for the reviewer (which we want to avoid).

Any ideas?
 
M

macropod

Hi Whitney,
The plan you supplied would force the reviewer to tab through form fields that they need not review in this way.
Adding the on-entry and on-exit macros as described should allow the user to switch between the formfields and the unprotected
Sections at will. There is no need to tab through other formfields - the only way you could get into that situation is if only one
of the formfields had the on-exit macro attached.

--
Cheers
macropod
[Microsoft MVP - Word]


Whitney Serio said:
Macropod,

(Obviously I have been side tracked with other projects). The plan you supplied would force the reviewer to tab through form
fields that they need not review in this way.

Is there a way I could create an add-in for example that would allow the user to turn track changes on but only for unprotected
sections?


macropod said:
Hi Whitney,

You could try something along the following lines:
1. Insert the following macro into the fiel's 'This Document' module:
Private Sub Document_Open()
Pwd = "Password"
End Sub
replacing 'Password' with the real password.

2. Add the following subs to a standard vba module for the file:
Public Pwd As String

Sub TrkOff()
With ActiveDocument
.Unprotect Password:=Pwd
.TrackRevisions = False
.Protect Type:=wdAllowOnlyFormFields, noreset:=True, Password:=Pwd
End With
End Sub

Sub TrkOn()
With ActiveDocument
.Unprotect Password:=Pwd
.TrackRevisions = True
.Protect Type:=wdAllowOnlyFormFields, noreset:=True, Password:=Pwd
End With
End Sub

3. Make the 'TrkOff' macro the 'On Entry' macro and the 'TrkOn' macro the 'On Exit' macro for every formfield

4. Save, close & re-open the document. Now, whenever you tab out of a formfield into an unprotected Section, change tracking
should be active, but it won't be when working with the formfields in the protected Sections.

--
Cheers
macropod
[Microsoft MVP - Word]


Whitney Serio said:
We use a word form for people in the field, who fill it out then return it to a reviewer. One of the reviewers would like to be
able to use track changes...

Is it possible to allow the reviewer to only have access to unprotected sections in track changes?

I realize i could use a snippet to provide the ability to unlock the doc, and relock it in track changes- (and in fact do this
here in office) but then i have the problem of how to allow the reviewer to accept changes without unlocking the document for
the reviewer (which we want to avoid).

Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top