IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Were you in Design Mode?
When you drop a command button on the document it puts you in Design Mode. Click the first button on the Control Toolbox to toggle this mode. When not in design mode you can protect the form.

You'll also need to do something like this to toggle the protection off while adding the row:
\nPrivate Sub CommandButton1_Click()\nActiveDocument.Unprotect\nActiveDocument.Tables(1).Rows.Add\n' ... add form fields here ...\nActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True\nEnd Sub\n

Edit: Which could be a problem if you are password protecting the document. If you just want to keep the casual misplaced cursor from doing damage to the form, then it should be OK.

This was all in Word 2002 (aka XP)
--
Chris Altmann
Expand Edited by altmann April 29, 2004, 08:10:17 PM EDT
New Initial test works.
Can unprotect form, add row to table and reprotect form (With password). Must still read up to figure out how to put the formfields in the new row.

Thanks for help.
     Any MS Word experts? - (jbrabeck) - (5)
         OT: That's not a document, that's an application - (drewk) - (2)
             But, when all you have is a hammer... :-) - (jbrabeck) - (1)
                 You screwed up, you took initiative, it *must* be punished -NT - (drewk)
         Were you in Design Mode? - (altmann) - (1)
             Initial test works. - (jbrabeck)

Not the sharpest knives in the drawer by far.
57 ms