View Single Post
  #5   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Lock table header to prevent modification

See:

http://www.mousetrax.com/techpage.html#autoforms

Please Fill Out This Form
Part 1: Create professional looking forms in Word
http://www.computorcompanion.com/LPMArticle.asp?ID=22

Part 2: Adding Automation to your Word forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=46

Part 3: Learn more VBA (macros) to automate your forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=119

Part 4: Use custom dialog boxes in your Word forms
http://www.computorcompanion.com/LPMArticle.asp?ID=127

Part 5: Connect your AutoForm to a database to save input time and keep
better records!
http://www.computorcompanion.com/LPMArticle.asp?ID=136


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

" wrote in
message ...
Hi Doug

I do not understand the formfield that you refer to. I have a Word
document that I have created a customized table and want to lock
Headers on certain lines and then have other lines to have the capability
of
typing info in, changing info as needed. I first thought of an
interactive,
fill-in
pdf but then thought why not just use my existing Word document and modify
so the headers cannot be changed. I am stumped though. Appreciate your
feedback. Thanks
--
mnemaus


"Doug Robbins - Word MVP" wrote:

If you can live with the limitations imposed by using a document that is
protected for forms, you could insert formfields into the cells in the
rows
in which you want to be able to insert data and when you protect the
document, other areas of it cannot be accessed.

If you need to be able to add more rows, containing the formfields, the
following macro can he used for that if it is set to be run on exit from
the
last formfield in the last row of the table. It contains and example of
how
you would have a couple of the formfields set as dropdown type
formfields,
but that can be changed if that is not required.

Dim rownum As Integer, i As Integer
With ActiveDocument
.Unprotect
.Tables(1).Rows.Add
rownum = .Tables(1).Rows.Count
For i = 1 To 3
.FormFields.Add Range:=.Tables(1).Cell(rownum, i).Range,
Type:=wdFieldFormTextInput
Next i
.FormFields.Add Range:=.Tables(1).Cell(rownum, 4).Range,
Type:=wdFieldFormDropDown
With .Tables(1).Cell(rownum,
4).Range.FormFields(1).DropDown.ListEntries
.Add "Item1"
.Add "Item2"
.Add "Item3"
.Add "Item4"
.Add "Item5"
End With
.FormFields.Add Range:=.Tables(1).Cell(rownum, 5).Range,
Type:=wdFieldFormDropDown
With .Tables(1).Cell(rownum,
5).Range.FormFields(1).DropDown.ListEntries
.Add "ItemA"
.Add "ItemB"
.Add "ItemC"
.Add "ItemD"
.Add "ItemE"
End With
.Tables(1).Cell(rownum, 5).Range.FormFields(1).ExitMacro = "addrow"
.Tables(1).Cell(rownum, 1).Range.FormFields(1).Select
.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Bjorn" wrote in message
...
I need to create a document that has multiple tables, and each table
will
have a header that never changes and then subsequent rows below the
header
in
which I can enter text. For example, I would like to create a table
that
has
a header of "Client contacts" as the first row of the table that can't
be
clicked into or modified (because it is locked) and then have one or
more
rows below the header where I can enter the actual client contact
information.

I don't know if this is possible but it would make the document
template
much easier to use because you wouldn't have to worry about clicking
into
the
header and entering something by mistake.
--
Bjorn