Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
Kathryn Pundt Kathryn Pundt is offline
external usenet poster
 
Posts: 1
Default How do I lock a table cell in Word?

I am creating a template in Word using tables. I want to lock certain cells
so no one can alter the contents.
  #2   Report Post  
Posted to microsoft.public.word.tables
Cindy M. Cindy M. is offline
external usenet poster
 
Posts: 2,416
Default How do I lock a table cell in Word?

Hi ?B?S2F0aHJ5biBQdW5kdA==?=,

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

Which version of Word do you have?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)

  #3   Report Post  
Posted to microsoft.public.word.tables
alborg alborg is offline
external usenet poster
 
Posts: 67
Default How do I lock a table cell in Word?

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.

  #4   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?

Word 2003 (11...)

"Cindy M." wrote:

Hi ?B?S2F0aHJ5biBQdW5kdA==?=,

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

Which version of Word do you have?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)


  #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.



  #6   Report Post  
Posted to microsoft.public.word.tables
alborg alborg is offline
external usenet poster
 
Posts: 67
Default How do I lock a table cell in Word?

I know- that's the whole point of locking the document, thus forcing the use
of textboxes. If you place a textbox inside a cell, you can lock THAT as
depicted!

Cheers,
Al

"Kathryn Pundt" wrote:

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.

  #7   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?

I'm am not sure I understand. This is what I understand you are trying to
convey.

Create a table. Insert textboxes into the table? Then, lock the texbox?

"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.

  #8   Report Post  
Posted to microsoft.public.word.tables
alborg alborg is offline
external usenet poster
 
Posts: 67
Default How do I lock a table cell in Word?

Hi Kathryn:

Yup... that's it. You gotta "lock" (i.e. disable) the textbox controls, not
the table.

BTW, the idea on how to programmatically add new rows with textboxes was
obtained from one of the most popular threads (check Show- Helpful threads)
with the title "Subject: How to insert multiple rows in tables". It
really is cool. The way I did it is the slightly improved version that works
in Word 2000/2002/2003 since the textbox "name" method didn't work in the MS
Word 2000 due to a Word bug.

Cheers,
AL

"Kathryn Pundt" wrote:

I'm am not sure I understand. This is what I understand you are trying to
convey.

Create a table. Insert textboxes into the table? Then, lock the texbox?

"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.

  #9   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?

Okay, I'll let you know how it goes.

As for the "how to programmatically add new rows with textboxes "
instructions, I don't know how to use user-programming. But, am very willing
to learn if you have the time...

"alborg" wrote:

Hi Kathryn:

Yup... that's it. You gotta "lock" (i.e. disable) the textbox controls, not
the table.

BTW, the idea on how to programmatically add new rows with textboxes was
obtained from one of the most popular threads (check Show- Helpful threads)
with the title "Subject: How to insert multiple rows in tables". It
really is cool. The way I did it is the slightly improved version that works
in Word 2000/2002/2003 since the textbox "name" method didn't work in the MS
Word 2000 due to a Word bug.

Cheers,
AL

"Kathryn Pundt" wrote:

I'm am not sure I understand. This is what I understand you are trying to
convey.

Create a table. Insert textboxes into the table? Then, lock the texbox?

"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.

  #10   Report Post  
Posted to microsoft.public.word.tables
alborg alborg is offline
external usenet poster
 
Posts: 67
Default How do I lock a table cell in Word?

Hi Kathryn:

Begin by looking at how the end result works- download the applet that I use
to follow patients in the hospital from-

http://www.emrupdate.com/files/folde...ntry67024.aspx

Tonight I'll guide you through how to add in the new textfields- not all
that hard.

Cheers,
Al


"Kathryn Pundt" wrote:

Okay, I'll let you know how it goes.

As for the "how to programmatically add new rows with textboxes "
instructions, I don't know how to use user-programming. But, am very willing
to learn if you have the time...

"alborg" wrote:

Hi Kathryn:

Yup... that's it. You gotta "lock" (i.e. disable) the textbox controls, not
the table.

BTW, the idea on how to programmatically add new rows with textboxes was
obtained from one of the most popular threads (check Show- Helpful threads)
with the title "Subject: How to insert multiple rows in tables". It
really is cool. The way I did it is the slightly improved version that works
in Word 2000/2002/2003 since the textbox "name" method didn't work in the MS
Word 2000 due to a Word bug.

Cheers,
AL

"Kathryn Pundt" wrote:

I'm am not sure I understand. This is what I understand you are trying to
convey.

Create a table. Insert textboxes into the table? Then, lock the texbox?

"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.



  #11   Report Post  
Posted to microsoft.public.word.tables
alborg alborg is offline
external usenet poster
 
Posts: 67
Default How do I lock a table cell in Word?

Hi Kathryn:

Ok... here goes...

1. Place table on your template. For this example, place a 2 row, 2 column
template.
2. Click on View†’ Toolbars†’ check on the €śForms€ť toolbar
3. Click on the €śab€ť icon repeatedly to add in a Text Form Field inside each
of the 4 table cells. Leave the right sided padlock in the €śunlocked€ť or flat
position.
4. Click on View- Toolbars- check on the "Visual Basic" toolbar
5. Now click on the Visual Basic icon to go to the VB environment.
6. Once there, click on Tools- References and make sure that you have some
of the ones you'll most likely need (to avoid errors)-

€˘ Visual Basic for Applications
€˘ Microsoft Word 11.0 Object Library
€˘ OLE Automation
€˘ Microsoft Office 11.0 Object Library
€˘ Microsoft DAO 3.6 Object Library
€˘ Microsoft Visual Basic for Applications Extensibility 5.3

Some other ones that I occasionally use depending on what I"m programming-

€˘ Microsoft ActiveX Data Objects 2.8 Library
€˘ Microsoft Jet and Replication Objects 2.6 Library
€˘ Microsoft Calendar Control 11.0
€˘ Microsoft Forms 2.0 Object Library

(Depending on your Word version, the version number could change, s.a.
Microsoft Office 9.0 for Word 2000)
7. Now click on View†’ Project Explorer
8. Right click on your project name, then select Insert†’ Module
9. Rename the module €śAutoMacros€ť and add the following Sub routines-

Sub addrow()
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.Tabl es(1).Rows.Count,
1).Range.FormFields(1).Select
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End If
End Sub

10. Save your work.
11. Now get out of the Visual Basic platform and go back to your table.
Right click on both of the RIGHT sided Text Form Fields, then Properties†’
€śRun macro on€ť†’ then in the €śExit€ť combobox choose your new subroutine
(€śaddrow€ť).

Finished! Now lock your form (i.e. click on/indent the padlock) and try
landing, then exiting on one of the activated fields. Should work. Cool huh?
Thats programming€¦

Cheers,
Al


"Kathryn Pundt" wrote:

Okay, I'll let you know how it goes.

As for the "how to programmatically add new rows with textboxes "
instructions, I don't know how to use user-programming. But, am very willing
to learn if you have the time...

"alborg" wrote:

Hi Kathryn:

Yup... that's it. You gotta "lock" (i.e. disable) the textbox controls, not
the table.

BTW, the idea on how to programmatically add new rows with textboxes was
obtained from one of the most popular threads (check Show- Helpful threads)
with the title "Subject: How to insert multiple rows in tables". It
really is cool. The way I did it is the slightly improved version that works
in Word 2000/2002/2003 since the textbox "name" method didn't work in the MS
Word 2000 due to a Word bug.

Cheers,
AL

"Kathryn Pundt" wrote:

I'm am not sure I understand. This is what I understand you are trying to
convey.

Create a table. Insert textboxes into the table? Then, lock the texbox?

"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.

  #12   Report Post  
Posted to microsoft.public.word.tables
alborg alborg is offline
external usenet poster
 
Posts: 67
Default How do I lock a table cell in Word?

Hi Kathryn:

One error-

THIS: "Place table on your template. For this example, place a 2 row, 2
column
template."
SHOULD READ AS: "Place table on your template. For this example, place a 2
row, 2 column [table]."

ALSO: I forgot to add the enabled line-

"ActiveDocument.Tables(1).Columns.Count).Range.For mFields(1).Enabled = False"

What you can do is to disable the prior row's FormFields-

"ActiveDocument.Tables(1).Cell(ActiveDocument.Tabl es(1).Rows.Count-1,
ActiveDocument.Tables(1).Columns.Count).Range.Form Fields(1).Enabled = False"

[note the ...Rows.Count-1...]

Cheers,
Al



"Kathryn Pundt" wrote:

Okay, I'll let you know how it goes.

As for the "how to programmatically add new rows with textboxes "
instructions, I don't know how to use user-programming. But, am very willing
to learn if you have the time...

"alborg" wrote:

Hi Kathryn:

Yup... that's it. You gotta "lock" (i.e. disable) the textbox controls, not
the table.

BTW, the idea on how to programmatically add new rows with textboxes was
obtained from one of the most popular threads (check Show- Helpful threads)
with the title "Subject: How to insert multiple rows in tables". It
really is cool. The way I did it is the slightly improved version that works
in Word 2000/2002/2003 since the textbox "name" method didn't work in the MS
Word 2000 due to a Word bug.

Cheers,
AL

"Kathryn Pundt" wrote:

I'm am not sure I understand. This is what I understand you are trying to
convey.

Create a table. Insert textboxes into the table? Then, lock the texbox?

"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.

  #13   Report Post  
Posted to microsoft.public.word.tables
Cindy M. Cindy M. is offline
external usenet poster
 
Posts: 2,416
Default How do I lock a table cell in Word?

Hi ?B?S2F0aHJ5biBQdW5kdA==?=,

Word 2003 (11...)

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


Word 2003 offers you the option of locking certain parts of the document, leaving
others open for editing. The advantage of this approach over form fields (the other
suggestion you're struggling with) is that the user can still use most formatting
and other editing commands.

When you do Tools/Protect Document you'll see the choice "No changes (Read only)"
in the second part of the Protection task pane. You select the parts of the
document you want to leave free, then click "Everyone" in the third section of the
task pane.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply in
the newsgroup and not by e-mail :-)

  #14   Report Post  
Posted to microsoft.public.word.tables
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default How do I lock a table cell in Word?

Cindy has already told you how to use the controls in Word 2003. Note that
the result will be that the entire document will be locked in previous
versions, so if any of the users are using Wor 2002 or earlier, this may not
be satisfactory. If you want to pursue the idea of using form fields, see
the forms tutorials linked from
http://word.mvps.org/FAQs/Customizat...nTheBlanks.htm, which will
explain how to use form fields (which are not ordinary text boxes but text
form fields).

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Kathryn Pundt" Kathryn wrote in message
news
I am creating a template in Word using tables. I want to lock certain

cells
so no one can alter the contents.


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I lock a cell in a table so no one can type in the cell? Jen0678 Tables 2 April 11th 07 10:50 PM
How do I lock a cell in a table in WORD? Barry.Holland Tables 1 January 25th 05 12:22 AM
How do you lock a cell in a WORD table? Barry.Holland Tables 1 January 19th 05 06:14 PM
Lock a Cell in Word Table? LB Microsoft Word Help 1 December 8th 04 11:42 PM
How do I protect/lock an individual cell in a table in WORD? dickkpe Tables 3 November 19th 04 05:28 PM


All times are GMT +1. The time now is 11:45 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"