Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.tables
|
|||
|
|||
Stop adding rows to end of table
Hi,
I'm creating a form. I have a section break and an unprotected section with a table in it as this section may (or may not) need a lot of text. The next section is protected. I want the users to move around the form using the tab key, but when they are in the unprotected table, the tab key adds another line to the end of the table. Does anyone know how to stop this? Thanks |
#2
Posted to microsoft.public.word.tables
|
|||
|
|||
Stop adding rows to end of table
If you put the table inside a TextBox, while pressing the tab key may add
another row, it will not be visible and the user will soon get the message. -- 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 "olwenh" wrote in message ... Hi, I'm creating a form. I have a section break and an unprotected section with a table in it as this section may (or may not) need a lot of text. The next section is protected. I want the users to move around the form using the tab key, but when they are in the unprotected table, the tab key adds another line to the end of the table. Does anyone know how to stop this? Thanks |
#3
Posted to microsoft.public.word.tables
|
|||
|
|||
Stop adding rows to end of table
Hi,
I've tried that but it doesn't solve the problem. The reason I need to use an unprotected section with a table in it, is because I need the cell of the table where the text is written to grow & shrink according to the amount of text entered. By putting a text box around it, the box size is fixed. Any other ideas? Thanks "olwenh" wrote: Hi, I'm creating a form. I have a section break and an unprotected section with a table in it as this section may (or may not) need a lot of text. The next section is protected. I want the users to move around the form using the tab key, but when they are in the unprotected table, the tab key adds another line to the end of the table. Does anyone know how to stop this? Thanks |
#4
Posted to microsoft.public.word.tables
|
|||
|
|||
Stop adding rows to end of table
Hi olwenh,
if it has to be, you may define a global variable R of allowed rows for a table, also a global table object T. And in addition a selection-change event, which checks the number of rows in T. I don't think you can prevent the adding of a row, but you may delete the last row, immediately after it was created. ' ---------------- NewMacros Option Explicit Dim oAppClass As New ThisApplication Dim R As Long Dim T As Table Sub Macro1() ' Or autoexec, autonew or whatever Set oAppClass.oApp = Word.Application Set T = ActiveDocument.Tables(1) R = T.Rows.Count End Sub Sub Test4() If T.Rows.Count R Then T.Rows.Last.Delete End If End Sub ' ----------------------- ThisApplication Option Explicit Public WithEvents oApp As Word.Application Private Sub oApp_WindowSelectionChange(ByVal Sel As Selection) Test4 ' or the code of Test4 End Sub A weird workaraound, sure. -- Greetings from Bavaria, Germany Helmut Weber, MVP WordVBA Win XP, Office 2003 "red.sys" & Chr$(64) & "t-online.de" |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding rows to a table | Tables | |||
Adding rows to a table | New Users | |||
Why do rows in a table stack when adding a new row? | Tables | |||
Q: Automatically adding form fields to new rows in table | Tables | |||
Adding multiple rows to a table in Word? | Microsoft Word Help |