PDA

View Full Version : Solved: Using trackrevisions and protectedforforms at the same time



cunnus88
06-30-2005, 10:41 PM
Again, I thank all of you for providing me with informed, reliable answers.

This time, my question has to do with using trackrevisions and protectedforforms at the same time.

I originally developed my macro in Office 2003. I divided a document into sections, and every third section would have the following property:

activedocument.sections(currentsectionindex).protectedforforms = true

Finally, I would activate revision tracking.

Activedocument.trackrevisions = true

In office 2003, i got the results I wanted. All the sections which weren't protected for forms would allow revisions and the other sections (which had dropdown formfields) would allow formfield interaction by the user.

Then I took this same macro to an earlier version of office, and, oh dear lord, the formfields would just disappear after I changed the value of a dropdown formfield.

Is there any way to keep formfields from disappearing in lesser versions of office?

MOS MASTER
07-01-2005, 09:54 AM
Hi, :yes

The key is using the argument NoReset:=True in your protection code!
This will keep the fields from being reset/emptied out!

A normal Protection routine for a document could look like this:
Option Explicit
Sub ProtectForForms()
With ActiveDocument
If .ProtectionType <> wdNoProtection Then .Unprotect Password:=""
'Do things to de document

.Sections(1).ProtectedForForms = True
.Sections(2).ProtectedForForms = False

.Protect Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=""
End With
End Sub


Later..:whistle:

cunnus88
07-04-2005, 05:38 PM
Thanks for the input.

Unfortunately, I have that line in my original code, and the formfields still disappear in Office versions 10 or less.

Anyway, I found a weird workaround to the problem. So now, I can have dropdown formfields and track revisions at the same time in Office 10 but not in 9.

It goes something like this:

thisdocument.Trackrevisions = true
thisdocument.usercontrol = true
for each formfield in thisdocument.formfields
formfield.helptext = ""
next

Don't know why, but it works.

Again, thanks for your time.

MOS MASTER
07-05-2005, 10:28 AM
Hi, :yes

Glad I could help and you're welcome!
I must admit the work arround seams strange to me...but if it works what the heck..:whistle:

untitled
08-21-2007, 01:16 AM
This helped me today, cheers.

:D