Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.tables
|
|||
|
|||
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
Posted to microsoft.public.word.tables
|
|||
|
|||
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
Posted to microsoft.public.word.tables
|
|||
|
|||
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
Posted to microsoft.public.word.tables
|
|||
|
|||
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
Posted to microsoft.public.word.tables
|
|||
|
|||
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 |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
What does modification not allowed because selection is lock? | Microsoft Word Help | |||
modification lock | New Users | |||
How to lock styles to prevent changes? | Formatting Long Documents | |||
How to I lock a template for modification only? | Microsoft Word Help | |||
prevent table from spanning header and footer | Tables |