View Single Post
  #5   Report Post  
Posted to microsoft.public.word.tables
Kathryn Pundt[_2_] Kathryn Pundt[_2_] is offline
external usenet poster
 
Posts: 24
Default How do I lock a table cell in Word?

Tables (not textbox) doesn't appear to have the capability.
I am using Word 2003 (11....)

"alborg" wrote:

Hi Kathryn:

Ok- this should do it for you...

1. Manual Method-

- right click on the textbox
- select Properties
- uncheck "Fill-in enabled"

2. Programmatic Method-
(in this example, you add 2 fields, each into a cell in your table, but
disabling the second field)

Dim rownum As Integer, i As Integer
response = MsgBox("Add new row?", vbQuestion + vbYesNo)
If response = vbYes Then
ActiveDocument.Unprotect
ActiveDocument.Tables(1).Rows.Add
rownum = ActiveDocument.Tables(1).Rows.Count

For i = 1 To ActiveDocument.Tables(1).Columns.Count
ActiveDocument.FormFields.Add Range:=ActiveDocument.Tables(1).Cell(rownum,
i).Range, Type:=wdFieldFormTextInput
Next i
ActiveDocument.Tables(1).Cell(ActiveDocument.Table s(1).Rows.Count,
ActiveDocument.Tables(1).Columns.Count - 1).Range.FormFields(1).EntryMacro =
"addinfo"
ActiveDocument.Tables(1).Cell(ActiveDocument.Table s(1).Rows.Count,
ActiveDocument.Tables(1).Columns.Count).Range.Form Fields(1).ExitMacro =
"addrow"
ActiveDocument.Tables(1).Cell(ActiveDocument.Table s(1).Rows.Count,
ActiveDocument.Tables(1).Columns.Count).Range.Form Fields(1).Enabled = False
'ActiveDocument.Tables(1).Cell(ActiveDocument.Tabl es(1).Rows.Count,
1).Range.FormFields(1).Select
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End If

Cheers,
Al

"Kathryn Pundt" wrote:

I am creating a template in Word using tables. I want to lock certain cells
so no one can alter the contents.