A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Tables
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Lock table header to prevent modification



 
 
Thread Tools Display Modes
  #1  
Old February 18th, 2008, 11:50 PM posted to microsoft.public.word.tables
bjorn
external usenet poster
 
Posts: 10
Default Lock table header to prevent modification

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
  #2  
Old February 19th, 2008, 03:46 AM posted to microsoft.public.word.tables
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
Default Lock table header to prevent modification

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



  #3  
Old February 19th, 2008, 02:19 PM posted to microsoft.public.word.tables
Jean-Guy Marcil[_2_]
external usenet poster
 
Posts: 374
Default Lock table header to prevent modification

"Bjorn" wrote:

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.


Here is something I have done before for more or less the same reasons you
write about. If you can have all new tables in the document start on a new
page, then you can use New Page section breaks between each table. Then,
making sure you do not link each header to the the header in the previous
section, you can position the table header (the first (or first few) row) in
the header. With careful measurements and a few print out test, you can
position the table header exactly. This way, users cannot click in the table
header as it will be in the page header.

  #4  
Old February 19th, 2008, 08:02 PM posted to microsoft.public.word.tables
[email protected]
external usenet poster
 
Posts: 1
Default Lock table header to prevent modification

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




  #5  
Old February 19th, 2008, 09:51 PM posted to microsoft.public.word.tables
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
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






  #6  
Old February 19th, 2008, 10:41 PM
Henk57 Henk57 is offline
Senior Member
 
First recorded activity by OfficeFrustration: Oct 2006
Posts: 387
Send a message via Skype™ to Henk57
Default

Quote:
Originally Posted by Doug Robbins - Word MVP View Post
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



Along similar lines Jean-Guy suggest, I would consider to link your table header from another "dummy" table header. (Copy then Edit/Paste Special.../Paste as link). You can put the table header in a place far from the actual table with the data, e.g. somewhere in an accompanying page, or even in a different document with password protection.
Ok, it still can be changed (and the header can be removed), but not accidentally. HTH
__________________
Henk van Ekelenburg
co-author of the eBook "Mastering Microsoft Word for Scientific Reports" (and other long documents)
www.masteringword.eu/?Off
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:14 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.