From: tikouka on
This has weird behavior, so I am sure it is a bug.

I am trying to auto-total table columns in a document template (not a VBA
form). The fields are ActiveX textboxes and in VBA I simply assign them to
integers and total; ie effectively adding the values in TextBox1, Textbox2
etc to total in TextBox9.

Then I assign the "Filling in forms" protection to the document.

It works fine and dandy in the template (dotm) that I am creating, but it
all goes wrong when I create a docm from it (which is of course what I want
the users to do).

When you open up a document from the template (setting the Option to allow
content), the non-enterable stuff is protected OK, but the textbox fields
appear like they are editable; that is, they have expansion handles around
the edges. But they are not enterable.

Now here's the really odd part. If I take off the protection and then
immediately apply it again, all is well - the textboxes are enterable (the
handles disappear) and the totalling works fine.

Of course, there is no way I can instruct the users to do this, otherwise
what is the point of making the document protected in the first place.

Note that I have populated ActiveX ComboBoxes successfully with VBA in
another protected document, so I can't think it is a compatibility problem.
From: Fumei2 via OfficeKB.com on
If the handles are visible this suggests you are in Design mode. I do not
know about 2007, but it may be the same as 2003.

ActiveDocument.ToggleFormsDesign


tikouka wrote:
>This has weird behavior, so I am sure it is a bug.
>
>I am trying to auto-total table columns in a document template (not a VBA
>form). The fields are ActiveX textboxes and in VBA I simply assign them to
>integers and total; ie effectively adding the values in TextBox1, Textbox2
>etc to total in TextBox9.
>
>Then I assign the "Filling in forms" protection to the document.
>
>It works fine and dandy in the template (dotm) that I am creating, but it
>all goes wrong when I create a docm from it (which is of course what I want
>the users to do).
>
>When you open up a document from the template (setting the Option to allow
>content), the non-enterable stuff is protected OK, but the textbox fields
>appear like they are editable; that is, they have expansion handles around
>the edges. But they are not enterable.
>
>Now here's the really odd part. If I take off the protection and then
>immediately apply it again, all is well - the textboxes are enterable (the
>handles disappear) and the totalling works fine.
>
>Of course, there is no way I can instruct the users to do this, otherwise
>what is the point of making the document protected in the first place.
>
>Note that I have populated ActiveX ComboBoxes successfully with VBA in
>another protected document, so I can't think it is a compatibility problem.

--
Gerry

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/word-programming/201006/1