Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
olwenh olwenh is offline
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default 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   Report Post  
Posted to microsoft.public.word.tables
olwenh olwenh is offline
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.word.tables
Helmut Weber Helmut Weber is offline
external usenet poster
 
Posts: 139
Default 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

Posting Rules

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding rows to a table Peter Guest Tables 2 November 25th 06 07:49 AM
Adding rows to a table Peter Guest New Users 3 November 22nd 06 08:01 PM
Why do rows in a table stack when adding a new row? Dottie in Asheville NC Tables 2 March 26th 06 11:59 PM
Q: Automatically adding form fields to new rows in table Richard J Tables 1 December 29th 05 03:10 PM
Adding multiple rows to a table in Word? Iron Mt Library Guy Microsoft Word Help 3 February 5th 05 12:08 AM


All times are GMT +1. The time now is 11:11 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"